Wrong row selected when pressing down arrow key after sort

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
 
J

Jeff Gaines

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top