Hi
I am trying to apply a style to all RadGridView controls throughout my application. It sets a few properties, and applies the Windows8 theme.
However, the RadGridView control doesn't seem to work in quite the same way as the other Telerik controls I am using - I have applied the Windows8 theme to them as shown at item (1) in the code sample below. This, by itself, does not appear to affect the RadGridView. However, at this point, the other setters do take effect - ValidatesOnDataErrors behaves correctly.
In order to apply the theme, I resorted to item (2) - applying it via a setter - which correctly applies the theme. However, this appears to override the other setters - ValidatesOnDataErrors returns to default behaviour.
My question, therefore, is this: how can I apply the Windows8 theme to the grid via the style, without preventing other properties from taking effect? Is this a bug, or am I missing something in my code?
Thanks
Ben
I am trying to apply a style to all RadGridView controls throughout my application. It sets a few properties, and applies the Windows8 theme.
However, the RadGridView control doesn't seem to work in quite the same way as the other Telerik controls I am using - I have applied the Windows8 theme to them as shown at item (1) in the code sample below. This, by itself, does not appear to affect the RadGridView. However, at this point, the other setters do take effect - ValidatesOnDataErrors behaves correctly.
In order to apply the theme, I resorted to item (2) - applying it via a setter - which correctly applies the theme. However, this appears to override the other setters - ValidatesOnDataErrors returns to default behaviour.
<Style
x:Key=
"RadGridViewStyleBase"
telerik:StyleManager.BasedOn=
"Windows8" <!-- (1): does not seem to have any effect -->
TargetType=
"telerik:RadGridView"
>
<Setter
Property=
"AutoGenerateColumns"
Value=
"False"
/>
<Setter
Property=
"BorderThickness"
Value=
"0"
/>
<Setter
Property=
"BorderBrush"
Value=
"Transparent"
/>
<Setter
Property=
"ScrollViewer.HorizontalScrollBarVisibility"
Value=
"Auto"
/>
<Setter
Property=
"ScrollViewer.VerticalScrollBarVisibility"
Value=
"Auto"
/>
<Setter
Property=
"RowIndicatorVisibility"
Value=
"Collapsed"
/>
<Setter
Property=
"telerik:StyleManager.Theme" <!-- (2): appears to override all other setters -->
Value=
"Windows8"
/>
<Setter
Property=
"ValidatesOnDataErrors"
Value=
"InViewMode"
/>
</Style>
My question, therefore, is this: how can I apply the Windows8 theme to the grid via the style, without preventing other properties from taking effect? Is this a bug, or am I missing something in my code?
Thanks
Ben