Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 24 Apr 2024, 10:10

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Autosize columns in grid
PostPosted: 08 May 2013, 05:56 
Offline

Joined: 11 Apr 2013, 06:51
Posts: 13
Hi,

Is there any option to autosize columns width in TDBGridEh depending on their content?

Or should I fetch all rows and calculate the maximum width for each column? (that seems to be slow....except if i only check the visible rows....but scrolling would make my grid distrubingly jumpy because resizing the columns in every moment)


Top
 Profile  
 
PostPosted: 08 May 2013, 13:48 
Offline
Администратор

Joined: 22 Dec 2011, 20:19
Posts: 335
Hello

You can use next code to optimize width of the specific column
DBGrid1.FieldColumns['FieldName'].OptimizeWidth;
or
DBGrid1.Columns[0].OptimizeWidth;

Best regards
Admin

_________________
Best regards
Admin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group