|
|
Re: GridTableViewer and sorting [message #873059 is a reply to message #872778] |
Thu, 17 May 2012 12:35 |
|
I am using sorting on my GridTreeViewer - I assume it would be the same/similar on the GridTableViewer. Here's what I did:
1. Created my own Comparator class that extends ViewerComparator
2. On the GridTreeViewer (gtv) I called: gtv.setComparator(myViewerComparator)
3. On each GridColumn (gc) I added a selectionListener that would get the comparator and set any information that I wanted it to know (the sort direction, the columnNumber (I had different sorting I needed to do based on the column being sorted), set the sort direction marker on the column (gc.setSort(SORTDIRECTION);
4. refresh the gridTreeViewer (gtv.refresh()).
and then the comparator would be called and I did my sort
Sorry I don't have an example code set up for you....but I hope that this helps.
Sharon
|
|
|
Powered by
FUDForum. Page generated in 0.02754 seconds