Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid - Grid Colunm
Grid - Grid Colunm [message #61158] Tue, 09 December 2008 19: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] Thu, 11 December 2008 19: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] Thu, 11 December 2008 19: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: Thu Jul 24 23:40:45 EDT 2014

Powered by FUDForum. Page generated in 0.01686 seconds