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

Set width of AutoGeneratedColumns

1 Answer 118 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matteo
Top achievements
Rank 1
Matteo asked on 11 Sep 2015, 12:20 PM

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...

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 11 Sep 2015, 01:03 PM
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
Tags
GridView
Asked by
Matteo
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or