This is a migrated thread and some comments may be shown as answers.

How to custom autogenerated column width?

1 Answer 90 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Cooper
Top achievements
Rank 1
Cooper asked on 07 Aug 2014, 10:53 AM
Telerik members:

I  have some data from  List<object> liPatients. 

Radgridview will auto generated some columns from liPatients.  

I have used the code radGvAppointedByPatient.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

But some column's width still not enough.  how to set the some one autogenerated column?

thank you

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 08 Aug 2014, 06:14 AM
Hi Cooper,

Thank you for writing.

Setting the AutoSizeColumnsMode to ​Fill​ will take the current grid width, divide it on the number of the columns and the result will be assigned as width for each column. To have your columns size according to their content, you need to use the BestFitColumns​ method. 

More information about the sizing features of RadGridView is available here: http://www.telerik.com/help/winforms/gridview-columns-resizing-columns-programatically.html.

I hope this helps.

Regards,
Stefan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Cooper
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or