I'm trying to put row header text based on a converter function of the index of the row. I found a way to bind to the datagridrow like below, but i can't find how to get the row index of the datagridrow object.
<DataTemplate x:Key="MyRowHeaderTemplate" DataType="DataRowView">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="1,0,1,0" Padding="1,0,1,0"
Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGridRow}}, Path=Item}"/>
</DataTemplate>
How can i get the row index and use my converter function to set the row header text?
EDIT: i solved this using some helper extension of datagrid. (http://code.google.com/p/artur02/source/browse/trunk/DataGridExtensions/DataGridHelper.cs) On the AutoGeneratedColumns event, i set the each row's header using the GetRow function.