Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid, GridTableViewer and sorting
Grid, GridTableViewer and sorting [message #730238] Wed, 28 September 2011 00:37 Go to next message
Dhiresh Patel  is currently offline Dhiresh Patel Friend
Messages: 86
Registered: July 2009
Member
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 17:54 Go to previous messageGo to next message
Dhiresh Patel  is currently offline Dhiresh Patel Friend
Messages: 86
Registered: July 2009
Member
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 20:13 Go to previous messageGo to next message
Dhiresh Patel  is currently offline Dhiresh Patel Friend
Messages: 86
Registered: July 2009
Member
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 14:34 Go to previous message
Deryck Brown is currently offline Deryck BrownFriend
Messages: 1
Registered: March 2012
Junior Member
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: Thu Apr 25 11:52:02 GMT 2024

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

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

Back to the top