Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid - Grid Colunm
Grid - Grid Colunm [message #61158] Wed, 10 December 2008 00:28 Go to next message
Dhiresh Patel  is currently offline Dhiresh Patel
Messages: 79
Registered: July 2009
Member
I am using grid with GridTreeViewer.
I make first column fixed and remaining columns
moveable. Although the first column is fixed,
I am able to move other columns in front of it.

Is there a way to prevent other columns from moving before
the first column?

Appreciate any suggestions,

Thanks,

Dhiresh
Re: Grid - Grid Colunm [message #61207 is a reply to message #61158] Fri, 12 December 2008 00:51 Go to previous message
Dhiresh Patel  is currently offline Dhiresh Patel
Messages: 79
Registered: July 2009
Member
I added Listener to columns other than the first one and it worked

Listener listener = new Listener () {
public void handleEvent (Event e) {
switch (e.type) {
case SWT.Move:

GridColumn gc = (GridColumn)e.widget;
int[] tempArr = gc.getParent().getColumnOrder();
if (tempArr[0] != 0){
tempArr[1] = tempArr[0];
tempArr[0] = 0;
grid.setColumnOrder(tempArr);
grid.update();
}
break;
default:
System.out.println ("Unknown event received");
}
}
};

grdCols[i].addListener(SWT.Move, listener);
Re: Grid - Grid Colunm [message #592955 is a reply to message #61158] Fri, 12 December 2008 00:51 Go to previous message
Dhiresh Patel  is currently offline Dhiresh Patel
Messages: 79
Registered: July 2009
Member
I added Listener to columns other than the first one and it worked

Listener listener = new Listener () {
public void handleEvent (Event e) {
switch (e.type) {
case SWT.Move:

GridColumn gc = (GridColumn)e.widget;
int[] tempArr = gc.getParent().getColumnOrder();
if (tempArr[0] != 0){
tempArr[1] = tempArr[0];
tempArr[0] = 0;
grid.setColumnOrder(tempArr);
grid.update();
}
break;
default:
System.out.println ("Unknown event received");
}
}
};

grdCols[i].addListener(SWT.Move, listener);
Previous Topic:Display Date Format in Foramtted / DatFormatter Text Field.
Next Topic:GridColumn visibility problem
Goto Forum:
  


Current Time: Sun Sep 21 04:16:59 GMT 2014

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

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