I have a sorted grid. When I add a new row I want to ensure that the row that is at the top of the list is the first one visible.
I would normall use somthing like FirstVisibleRow = GetSortedDataRows(true) or something like that but when adding a data row it doesn’t appear in the grid until after OnAddingDataRow is called which means that it’s not in the sorted data rows list.
I just wondered whether anyone has doen anything like this or nows a good shortcut.
Imported from legacy forums. Posted by Chris (had 2341 views)
How are you adding the row? If you are using an insertionRow you can use the RowInserted event in order to do this. If you are using .addNew or if you are dataBound, you will have to first call an EndEdit on the row and then Redo a GetSortedDataRow, you should now be able to set it to the proper row.
Imported from legacy forums. Posted by Matt (had 279 views)
It’s OK, I’ve figured a way around this, although a little slow. I could probably do with getting the blueprint edition and messing around with the scrollbars as this way is simple but slow.
Basically in the rows OnCellValueChanged method, I call GetSortedDataRow on the currenlty sorted column and then select the first item in the list. I need to get the blueprint edition to speed it up really.
Imported from legacy forums. Posted by Chris (had 3493 views)