We are trying to logically determine the next row to select if the currently selected row disappears. Users can select a row and perform an operation that may or may not cause this row to reappear after the grid is refreshed. We cannot determine in advance if the currently selected row will be in the refreshed dataset, and we need to perform a full refresh to display new data that may have appeared for the user. If the current row is in the refreshed dataset, that is no problem. Each row contains a unique identifier in a hidden column and we can save the unique identifier and reselect this row after refreshing.
The problem occurs if one or more of these rows disappear after a refresh. We want to move the selection to the previous row (right above the selection) as displayed to the user with sorting and grouping applied. How do we determine which row this would be?
Basically, we need to be able to answer this question: Which row is visually displayed immediately above the currently selected row?
We have it working for the most part, but the code is very complicated and still does not work exactly as we would like. For example, if the user selects the first row in a group and it disappears, the best that we can do is to go to the previous group and select the first row in that group. We would like to select the last row in the previous group. There are also problems if the entire group that contains the currenty selected row disappears.
The GridNavigator won't help because I don't actually want to select the next or previous row. I just want to know which row I would select if I were to call the SelectPreviousRow or SelectNextRow methods, find the unique identifier value in this row, and store it to select the desired row after refreshing.
The problem occurs if one or more of these rows disappear after a refresh. We want to move the selection to the previous row (right above the selection) as displayed to the user with sorting and grouping applied. How do we determine which row this would be?
Basically, we need to be able to answer this question: Which row is visually displayed immediately above the currently selected row?
We have it working for the most part, but the code is very complicated and still does not work exactly as we would like. For example, if the user selects the first row in a group and it disappears, the best that we can do is to go to the previous group and select the first row in that group. We would like to select the last row in the previous group. There are also problems if the entire group that contains the currenty selected row disappears.
The GridNavigator won't help because I don't actually want to select the next or previous row. I just want to know which row I would select if I were to call the SelectPreviousRow or SelectNextRow methods, find the unique identifier value in this row, and store it to select the desired row after refreshing.