Set width of AutoGeneratedColumns

2 posts, 0 answers
  1. Matteo
    Matteo avatar
    1 posts
    Member since:
    Sep 2015

    Posted 11 Sep 2015 Link to this post

    Hello everyone,

     We created a Custom Control which has a GridView as a part of it. We use the AutoGeneratingColumns functionality and the DisplayAttribute to define the header text. That works perfect. We want to set the Columns to a fixed width, and it would be great to do this with an Attribute or some sort of other way.

     Does anyone have a suggestion? We don't want to change the fact that the columns are auto generated.

    Thanks for any help...

  2. Ivan Ivanov
    Ivan Ivanov avatar
    1201 posts

    Posted 11 Sep 2015 Link to this post

    Hello Matteo,

    You can modify the columns' width by subscribing to  the AutogeneratingColumn event of RadGridView and set args.Column.Width. As you have access to the column's binding path, you can have a custom attribute set on the respective model property and you can read its value in the event handler.

    Ivan Ivanov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top