Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Automatically resize a column to fit the width of the longest text under that column

 
Subscribe to the RSS feed for this forum  Forum Index -> FileView.Net/WPF
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Tue Apr 21, 2009 4:30 am    Post subject: HOWTO: Automatically resize a column to fit the width of the longest text under that column

The following code automatically resizes a column to fit the width of the longest text under that column:

Code:
fileView1.SetColumnWidth(string.Empty,0,-1); // Autosize the column at index '0'
or
fileView1.SetColumnWidth("Name",0,-1); // Autosize the 'Name' column


Note
To make the last column expand to fit the FileView width, use the following code:

Code:
// Expand width of last column to fit FileView width
fileView1.SetColumnWidth(string.Empty,fileView1.ColumnCount-1,-2);
Back to top
Display posts from previous:   
Forum Index -> FileView.Net/WPF All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group