Hi Sergio Ayala,
You can achieve your requirement to show the record index for the parent Datagrid
alone using the below code snippet,
|
this.sfDataGrid1.DrawCell
+= SfDataGrid1_DrawCell;
private void SfDataGrid1_DrawCell(object sender,
Syncfusion.WinForms.DataGrid.Events.DrawCellEventArgs e)
{
if (sfDataGrid1.ShowRowHeader && e.RowIndex != 0
&& e.DataRow.RowType ==
Syncfusion.WinForms.DataGrid.Enums.RowType.DefaultRow)
{
if (e.ColumnIndex == 0)
{
int index = this.sfDataGrid1.View.Records.IndexOfRecord(e.DataRow.RowData
as OrderInfo);
e.DisplayText = (index +
1).ToString();
}
}
}
|
We have prepared the sample based on your requirement. Please
find the sample in the attachment and let us know if you have any concerns about
this.
Regards,
Dhanasekar M.
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.
Attachment:
DetailsViewDemo_WF_5ad5dd1b.zip