| programmatically resize column   [message #1197335] | 
Tue, 19 November 2013 16:38   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
I am using the Nattable in Eclipse plugin and I am trying to find an option to do the column resize programatically based on some user action.  I tried to use the InitializeAutoResizeColumnsCommand and it didnt correctly resize the columns. then I tried the solution in the link http://eclipse.org/nattable/documentation.php?page=faq and it did resize the column automatically but there is extra spacing in the column surrounding the text and also when I scroll the repainting of the columns is visible and it looks bad. Also it does the resize for all columns and I want to specifically resize a column based on index. I am using the 1.0.1 release. 
 
 
natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
	{
		cellPainter = new LineBorderDecorator(
						new TextPainter(false, true, 5, true));
	}
 
Is there any other way I can do the resize for a column. 
 |  
 |  
  | 
 | 
 | 
| Re: programmatically resize column   [message #1198191 is a reply to message #1197387] | 
Wed, 20 November 2013 02:33   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Quote:the grid hanged and it took a long time to resize  
 
Of course, because it iterates over the whole dataset and calculates the optimum size. 
 
Quote:the reason i say its bad is because when I scroll I see empty lines for a sec and then the cells are painted  
 
Yes this was reported several times already. But I don't see a solution for this. Resizing on rendering means that when the cell comes to the viewport the first time, the calculation is started. If you scroll further, the new cells in the viewport will be calculated. While calculating, the rendering pauses. I even tried to do that process in a background thread, but it doesn't change anything. You could think of setting the initial width higher to avoid too much calculation, but in general I don't see a suitable solution. 
 
If you find one, let me know.
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.03749 seconds