Did you presumably set the datasource on the grid? If so, use the data source and access it through its datasource index.
Using line descriptors can cause problems when sorting the grid. I recommend...
int dataIndex = gridView.GetDataSourceRowIndex(rowHandle); var myData = myDataSource[dataIndex];
Provided that you use a universal collection, the cast is not involved in it, and this handles grouping and sorting. Of course, what is displayed and what data may not match. For example, if the data is an enumeration. To do this, you would display the display name, but the value in the data source is enum. Usually I need a base value instead of the displayed text.
source share