My application uses the Q and A keys to go to the next item in an ObjectListView, which works fine until the user sorts the list items using one of the column headers. If the user sorted, then pressing the Q / A keys causes the list to move through the list items, as it seems to use the original order rather than the current order.
So, I'm looking for a solution that allows the user to move to the next element even after the user is sorted. The code I currently have (for key A only) is below:
if (e.KeyCode == Keys.A) { OLVListItem next = listSession.GetNextItem(listSession.SelectedItem); if (next == null) { return; } listSession.SelectedObject = (Session)next.RowObject; listSession.EnsureModelVisible((Session)next.RowObject); }
source share