| BestFit doesn't work if Resizable=False
 
 Printed From: Codejock Forums
 Category:  Codejock Products
 Forum Name:  Report Control
 Forum Description:  Topics Related to Codejock Report Control
 URL: http://forum.codejock.com/forum_posts.asp?TID=9945
 Printed Date: 30 October 2025 at 10:06pm
 Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
 
 
 Topic: BestFit doesn't work if Resizable=False
 Posted By: jpbro
 Subject: BestFit doesn't work if Resizable=False
 Date Posted: 22 March 2008 at 11:43pm
 
 
        
          | Hi, 
 I want to prevent the columns of a ReportControl from being resized by the user, but would like to automatically set the size of the column to show the entire contents of each column.
 
 If I set the Resizable property to False, then the BestFit method doesn't seem to do anything, however if Resizable = True then BestFit resizes the column to the correct width (but then the user can resize the column unfortunately).
 
 As a side note, a useful addition to the BestFit method would be an optional ExtraSpace parameter, so that you can automatically add an arbitrary number of pixels to the BestFit calculation.
 
 
 |  
 
 Replies:
 Posted By: jpbro
 Date Posted: 25 March 2008 at 9:53am
 
 
        
          | This behaviour seems to have changed in v12, but it still doesn't work. If the Resizable property for all of the columns is False, and then BestFit is called, the first column takes up the entire width of the ReportControl and the rest of the columns cannot be seen. 
 I think that BestFit should work the same regardless of whether the column is resizable by the user or not. Unless the intention of Resizable is to *both* the user and code from resizing a column (in which case BestFit should do nothing, and an AllowResize property should be available that prevents the user from resizing columns, but allows code to resize columns).
 
 |  
 Posted By: jpbro
 Date Posted: 25 March 2008 at 10:28am
 
 
        
          | Actually, it seems that BestFit just doesn't do anything on columns with  Resizable = False. |  
 
 |