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
    Admin
    Ivan Ivanov avatar
    1127 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.

    Regards,
    Ivan Ivanov
    Telerik
    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top