Wrong row selected when pressing down arrow key after sort

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

Hi everyone,

I'm having a frustrating problem with the datagrid control.

I have added code so that the currently selected row remains highlighted
even after a sort. This seems to work perfectly in all but one respect.

After the sort, the row will move position and will remain selected. The
problem comes when I press the down arrow key. When I do this the
selected row becomes the one immediately after where the previously
selected row had been before the sort.

This has the unfortunate effect of jumping the grid to a seemingly
random place leaving the user a bit bemused.

Can anyone tell me what I need to do to avoid this problem?

Thanks

Simon
 
After the sort, the row will move position and will remain selected. The
problem comes when I press the down arrow key. When I do this the selected
row becomes the one immediately after where the previously selected row
had been before the sort.

Is this because of the difference between the selected row and the focused
row? Can you set the focused row to be the same as the selected row after
the sort?
 
Back
Top