Selecting specific row by row number [message #1397877] |
Thu, 10 July 2014 05:31  |
Eclipse User |
|
|
|
Hi,
I would like to select a certain row by its number. I tried the approach with:
natTable.doCommand(new SelectRowsCommand(natTable, 1, rowNumber, false, false));
But this selects the row from the currently visible rows (so eg. scrolled to row 500 -> select row 2 -> selection is now 502 instead of 2)
Is there any better approach to do this?
|
|
|
Re: Selecting specific row by row number [message #1397902 is a reply to message #1397877] |
Thu, 10 July 2014 06:17   |
Eclipse User |
|
|
|
A coordinate in NatTable is a combination of layer and position. Your example will create the coordinate for NatTable row position 2. As you have a viewport, the position is related to the current scrolling position.
Try
natTable.doCommand(new SelectRowsCommand(dataLayer, 0, rowNumber, false, false));
which will use a DataLayer coordinate.
If that doesn't work, try
selectionLayer.doCommand(new SelectRowsCommand(selectionLayer, 0, rowNumber, false, false));
Although from my understanding the first one should work.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03951 seconds