I'm trying to understand a particular behavior about RowIndex. I'm checking RowIndex of each GridViewItem and it's not going like expected.
Instead of list 1,2,3 it's showing 2, 4, 6. I'm wondering why is it happening.
1 Answer, 1 is accepted
0
Accepted
Vessy
Telerik team
answered on 11 Dec 2020, 09:24 AM
Hi Rafael,
The RowIndex the index of the item in the rows collection of the underlying server Table control. In order to get the index of the actual rows in the Grid, you will need to use the ItemIndex property:
foreach (GridDataItem dataItem in grid.Items)
{
var index = dataItem.ItemIndex;
//your logic here
}
Regards,
Vessy
Progress Telerik
control
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.