How to remove TableColumns from Table [message #462330] |
Mon, 10 October 2005 16:40 |
Alan Messages: 44 Registered: July 2009 |
Member |
|
|
I want to display results from a SQL select query using the Table widget.
Everytime a SQL select query is executed, the application figures out the
columns and configure the Table object. What I do is before configuring
the table, the application removes all TableColumns, if any, from the
existing Table object
for(;tableViewer.getTable().getColumns().length>0;)
tableViewer.getTable().getColumns()[0].dispose();
I'm not sure if this is the right way to remove columns, though. Then the
application create new TableColumn based on the results.
for(.../** details ignored */){
new TableColumn(tableViewer.getTable(), SWT.CENTER);
column.setText(label);
}
Finally, the application populates the Table.
Everything goes smoothly for the first query. From the second query on,
the table display nothting after all columns are removed. Data will appear
in the Table correctly after I resize the view, for example.
Any hint appreciated.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03258 seconds