How to custom autogenerated column width?

2 posts, 1 answers
  1. Cooper
    Cooper avatar
    19 posts
    Member since:
    Mar 2014

    Posted 07 Aug 2014 Link to this post

    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
  2. Answer
    Stefan avatar
    2908 posts

    Posted 08 Aug 2014 Link to this post

    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:

    I hope this helps.

    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.
Back to Top