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

Binding Width on a GridViewDataColumn

1 Answer 103 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Geoff Hardy
Top achievements
Rank 1
Geoff Hardy asked on 06 Apr 2010, 06:45 PM
This is a suggestion for how the RadGridView could be improved - or maybe there is already a good way to achieve my goal.

It would be very useful if it was possible databind Width and other properties on a GridViewDataColumn. This would allow the width information to be abstracted elsewhere and width could be consistently across various columns and gridviews. For example, you could define a resource as:

<System:Int32 x:Key="readOnlyDateTimeWidth">125</System:Int32> 
 

Then you could use this on various RadGridViews to define columns such as:

<TelerikGrid:GridViewDataColumn DataMemberBinding="{Binding Details.LastUpdate}" Header="Last Update" DataFormatString="{}{0:g}" IsReadOnly="True" Width="{StaticResource readOnlyDateTimeWidth}"/>                 

It would also be useful to be able to databind other properties such as DataFormatString, etc.

Maybe another way to do this would be to add a Style property to the RadGridViewColumn that would allow various properties to be set, then you could do something like this:

<TelerikGrid:GridViewDataColumn DataMemberBinding="{Binding Details.LastUpdate}" Header="Last Update" Style="{StaticResource readOnlyDateTimeColumnStyle}"/>                  
 

This would allow the setting of multiple properties to be wrapped up in a style which could be consistently applied across many columns.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 07 Apr 2010, 06:23 AM
Hi,

Binding will work only for properties of FrameworkElements - grid columns are plain DependencyObjects.

Regards,
Vlad
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Geoff Hardy
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or