Hi Raghu,
Thanks for using Syncfusion
products.
We have analyzed your query, you
can achieve your requirement by enabling ShowRowHeader
API as true and you can set the row numbers in the row header by handling
QueryCellInfo event. You can handle event inside a Behavior in MVVM pattern.
Code Snippet:
<syncfusion:GridDataControl x:Name="SyncGrid"
AutoPopulateColumns="True"
ItemsSource="{StaticResource ComboSource}"
ShowAddNewRow="False"
ShowFilterBar="True"
ShowRowHeader="True">
<I:Interaction.Behaviors>
<local:QueryCellInfoBehavior/>
</I:Interaction.Behaviors>
</syncfusion:GridDataControl>
GDC.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);
void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
var style = e.Style as GridDataStyleInfo;
if (style.CellIdentity.TableCellType == GridDataTableCellType.RowHeaderCell)
{
e.Style.CellValue = e.Style.CellRowColumnIndex.RowIndex;
}
}
|
We have prepared a sample
based on your requirement and attached it in the following location.
Sample: GridDataControlSample.zip
Regards,
Divya.