Delphi QuantumGrid GetSelectedRowIndex after sorting

I have a D2006 and I am using DevExpress QuantumGrid 6 in a project. I am using it in unbound mode. I have multiple lines and need to call an action when the user selects a line and clicks a button. This works great when the grid is not user-sorted. I am using this code to identify the string the user has selected:

index := cxMainTable.DataController.GetSelectedRowIndex(0);
cxMainTable.DataController.Values[index, 0];

      

But when the user sorts the grid by clicking on the column header, the index returned is correct for the current displayed order, but the values ​​returned by the second row are the value you would expect if the grid was not sorted.

Thanks.

+1


a source to share


1 answer


You must distinguish between records and lines .



Maybe TableView.DataController.FocusedRecordIndex

this is what you want?

+2


a source







All Articles