As the documentation entry for getselectedrowindex states, the method “Gets the bound index of the selected row.” The bound index of a row is different from its visible index and disregards the applied sorting and filtering.
Is there a way to get the visible index of a given row?
Dimitar has mentioned the visible index in two forum answers but never has mentioned a way to get it even if by using the bound index of a row.
I need to tab throughtout the cells and rows of my grid but, since it uses the bound index, if the table has been ordered the focus can jump from the sixth visible row to the second if that’s where the next bound index is visually located after ordering.
Maybe I could craft a solution based on selected cells, visual row indexes and events…. But there does not seem to be a way to get the visual index of a row in the docs.
It is true that there is no direct method of getting a row’s visible index. However, you can get all filtered rows in their current order with the method getrows. It returns an array of said rows. The index number of each member of this array is the row’s visible index. From it, you can get the row’s bound index with getrowboundindex.