Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » adding columns to a table in a view at runtime
adding columns to a table in a view at runtime [message #466059] Fri, 30 December 2005 09:19 Go to next message
Eclipse UserFriend
Originally posted by: ayesha.ltp.soft.net

Hi,
I would like to know if there is a way to add a tablecolumn dynamically
at runtime after the view is opened. The table columns should be added
whenever a new column is added to the data model. I tried adding a table
column and invoked a pack on the table, but it didnt work.
Is there a way to do it?

Ayesha
Re: adding columns to a table in a view at runtime [message #466145 is a reply to message #466059] Tue, 03 January 2006 19:31 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Create a table column and set the width of the table column (e.g.
TableColumn.setWidth()) . You could also use TableColumn.pack() but this
will only work after you have set some data for that column (e.g.
TableColumn.setText() or TableItem.setText(int, String)). Packing the Table
itself will not resize the columns.

"Ayesha" <ayesha@ltp.soft.net> wrote in message
news:dp2tip$kdn$1@utils.eclipse.org...
> Hi,
> I would like to know if there is a way to add a tablecolumn dynamically
> at runtime after the view is opened. The table columns should be added
> whenever a new column is added to the data model. I tried adding a table
> column and invoked a pack on the table, but it didnt work.
> Is there a way to do it?
>
> Ayesha
>
>
Previous Topic:Problem executing SWT Snippet 212, v1.5
Next Topic:dispose
Goto Forum:
  


Current Time: Fri Mar 29 08:29:10 GMT 2024

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

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

Back to the top