My application uses the Q and A keys to move to the next item in an ObjectListView, which works great as long as the user doesn't sort the list items using one of the column headers. If the user has sorted, then pressing the Q/A keys causes the list to jump around the list items, as it seems to use the original order, rather than the current order.
So I am looking for a solution that allows the user to move to the next item even after the user has sorted. The code I currently have (just for the A key) 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);
}
GetNthItemInDisplayOrder()
andGetDisplayOrderOfItemIndex()
, but i didn't manage to come up with a working workaround. – Megrim