How to set the number of visible rows in Table? [message #521315] |
Wed, 17 March 2010 09:04 |
balcerman Messages: 17 Registered: March 2010 |
Junior Member |
|
|
Hello,
I have a table:
Table table = new Table(myComposite, SWT.MULTI);
//table.setItemCount(3);
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false);
table.setLinesVisible(true);
table.setHeaderVisible(true);
TableColumn tableColumn = new TableColumn(table, SWT.LEAD);
tableColumn.setText("Name");
tableColumn.setWidth(100);
tableColumn = new TableColumn(table, SWT.LEAD);
tableColumn.setText("Value");
tableColumn.setWidth(100);
viewer = new TableViewer(table);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
//viewer.setItemCount(3);
viewer.setInput(produktAnzahlList);
viewer.refresh();
How can I set the number of displayed rows to i.e. 3, independently from number of rows filled by user data?
I tried to do it in two ways - using method setItemCount() on Table object and on TableViewer object (see commented lines in the code above). The problem is, that while performing the line:
viewer.refresh();
an exception appears:
AssertionFailedException: null argument
which disappears when I comment out the setItemCount() call....
Is this method bugged or am I using it in wrong way?
Whether it's strange behavior and I'd like to understand it, most important to me is to know, how can I actually set the number of displayed rows?
[Updated on: Tue, 23 March 2010 08:38] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03635 seconds