title: concatenate strings in rowheader - xaml
body: <p>My problem is as follows: I have a datagrid that is bound to my datatable. I want a <code>Button</code> to be placed in the row header, and I want the <code>Button.Content</code> to display the concatenate of two strings. I have tried combining these two solutions: <a href="https://stackoverflow.com/questions/4791929/wpf-datagrid-rowheader-databinding">this</a> and <a href="https://stackoverflow.com/questions/541896/concatenate-strings-instead-of-using-a-stack-of-textblocks">this</a></p>
  
  <p>I have success with each individually, but combined it yields a blank <code>Button.Content</code>. Here's what I've tried</p>
  
  <pre><code>                   &lt;DataGrid.RowHeaderTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;Button Width="90"&gt;
                                  &lt;Button.Content&gt;
                                      &lt;MultiBinding StringFormat=" {0} - {1}"&gt;
                                          &lt;Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridRow}}" Path="Item.Index"/&gt;
                                          &lt;Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridRow}}" Path="Item.Category"/&gt;
                                      &lt;/MultiBinding&gt;
                                  &lt;/Button.Content&gt;
                              &lt;/Button&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/DataGrid.RowHeaderTemplate
  </code></pre>
  
  <p>Any help would be appreciated. </p>