Grid, GridTableViewer and sorting [message #730238] |
Tue, 27 September 2011 20:37  |
Eclipse User |
|
|
|
I am using Grid with GridTableViewer. I have enabled grid for cell selection.
grid.setCellSelectionEnabled(true);
I also have a comparator which I set to grid table viewer for sorting.
When the cell selection is on, sorting doesn't work. When cell selection is off,
then the sorting works. Why is this happening?
I would like sorting to work when - grid.setCellSelectionEnabled(true);
What do I have to do to make it work?
Thanks in advance.
Dhiresh
|
|
|
|
|
Re: Grid, GridTableViewer and sorting [message #826809 is a reply to message #730665] |
Thu, 22 March 2012 10:34  |
Eclipse User |
|
|
|
This is really simple to explain, and is caused by competition for what pressing the mouse in the column header is supposed to do.
If the column is movable, the mouse down is taken to be the start of a drag of the column to a new location.
If cell selection is enabled and the column is not movable, the mouse down is taken to be the start of a column selection. Clicking in the column header selects the column contents, and you can select multiple columns by dragging across multiple column headers.
If cell selection is disabled or the column is not movable, clicking the column header generates the events required to cause sorting.
Deryck
|
|
|
Powered by
FUDForum. Page generated in 0.03309 seconds