title: Column/Row index in a DataGrid column
body: <p>I was hoping the following would get me column index in the cell:</p>
  
  <pre><code>&lt;DataGridTemplateColumn Header="Rec. No." Width="100" IsReadOnly="True"&gt;
       &lt;DataGridTemplateColumn.CellTemplate&gt;
           &lt;DataTemplate&gt;
                &lt;TextBlock Text="{Binding Source={RelativeSource AncestorType=DataGridCell}, Path=Column.DisplayIndex}" /&gt;
           &lt;/DataTemplate&gt;
       &lt;/DataGridTemplateColumn.CellTemplate&gt;
  &lt;/DataGridTemplateColumn&gt;
  </code></pre>
  
  <p>But it didn't. Anyone can tell me what's wrong here?</p>
  
  <p>I'm actually looking for the row index (need a Record No. column in my grid), but since <code>DataGridRow</code> doesn't apparently have an "index" kind of property, I tried to first do it for column index, which has got <code>DisplayIndex</code>. But even this one doesn't work.</p>