|Updating selection when removing lines from table [message #810323]
||Thu, 01 March 2012 00:53
| John Lussmyer
Registered: December 2010
When my code has to delete something from the table, it usually is the selected row.|
So I have this code to move the selection to the previous row:
int selIdx = mTableView.getTable().getSelectionIndex();
mTableView.getTable().setSelection((selIdx > 0) ? (selIdx - 1) : 0);
mTableView.getTable().notifyListeners(SWT.Selection, new Event());
This works fine - EXCEPT if the currently selected item is row 0.
After the delete, and the above code executes. (reselecting row 0)
the table is left with no selection.
Am I missing something?
Powered by FUDForum
. Page generated in 0.01769 seconds