Skip to main content



      Home
Home » Eclipse Projects » Nebula » Grid, GridTableViewer and sorting
Grid, GridTableViewer and sorting [message #730238] Tue, 27 September 2011 20:37 Go to next message
Eclipse UserFriend
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 #730618 is a reply to message #730238] Wed, 28 September 2011 13:54 Go to previous messageGo to next message
Eclipse UserFriend
I tried setting Viewer with Viewer Sorter but that doesn't work either when
grid.setCellSelectionEnabled(true);

I have a viewPart that has multiple tables and grids. Would that be a problem?

I have another viewPart with only one grid and GridTableViewer, and it works.

Thanks,

Dhiresh
Re: Grid, GridTableViewer and sorting [message #730665 is a reply to message #730618] Wed, 28 September 2011 16:13 Go to previous messageGo to next message
Eclipse UserFriend
What I found out is that if I have GridColumn.setMoveable(false); then sorting doesn't
work when grid.setCellSelectionEnabled(true); As soon as I removed GridColumn.setMoveable(false); then sorting worked - of course I don't know why.

Dhiresh
Re: Grid, GridTableViewer and sorting [message #826809 is a reply to message #730665] Thu, 22 March 2012 10:34 Go to previous message
Eclipse UserFriend
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
Previous Topic:CalendarCombo: how can I open the calendar with another month then the actual month?
Next Topic:Change Section height of Gantt Diagram
Goto Forum:
  


Current Time: Wed Jul 02 19:36:29 EDT 2025

Powered by FUDForum. Page generated in 0.03309 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top