Greetings Telerik,
I have multiple RadGridViews which consist of both GridViewDataColumns as well as GridViewSelectColumns. Is there a way I can set the style for each column type once and have it apply to all RadGridViews?
If I include this style in the resources section of my application's MainWindow, it works fine and all cells will receive the styling I desire:
However that will affect checkboxes in GridViewSelectColumns which I would like to remain "centered" regarding their VerticalContentAlignment... so I tried this (also in the resources section of my Mainwindow):
However it does not seem to apply the styling to any cells... But, if I go to each column in each grid and set the style manually (using the same style) for each one it does work:
Any advice you could provide would be greatly appreciated. I'm using .NET 4.5.1 with Telerik UI for WPF Q3 2013 SP2 (13.3.1316.0) in Visual Studio 2013. Thanks!
Cheers,
Beau
I have multiple RadGridViews which consist of both GridViewDataColumns as well as GridViewSelectColumns. Is there a way I can set the style for each column type once and have it apply to all RadGridViews?
If I include this style in the resources section of my application's MainWindow, it works fine and all cells will receive the styling I desire:
<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="VerticalContentAlignment" Value="Top"/>
</Style>
However that will affect checkboxes in GridViewSelectColumns which I would like to remain "centered" regarding their VerticalContentAlignment... so I tried this (also in the resources section of my Mainwindow):
<Style TargetType="{x:Type telerik:GridViewDataColumn}">
<Setter Property="CellStyle">
<Setter.Value>
<Style TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="VerticalContentAlignment" Value="Top"/>
</Style>
</Setter.Value>
</Setter>
</Style>
However it does not seem to apply the styling to any cells... But, if I go to each column in each grid and set the style manually (using the same style) for each one it does work:
<Style x:Key="myStyle" TargetType="{x:Type telerik:GridViewCell}">
<Setter Property="VerticalContentAlignment" Value="Top"/>
</Style>
<telerik:RadGridView
x:Name="mygridview"
ShowGroupPanel="False"
ItemsSource="{Binding Path=MyView}"
AutoGenerateColumns="False"
SelectionMode="Extended"
SelectedItem="{Binding Path=SelectedRecord}"
RowIndicatorVisibility="Collapsed"
CanUserFreezeColumns="False"
CanUserDeleteRows="False"
ScrollMode="Deferred">
<telerik:RadGridView.Columns>
<telerik:GridViewSelectColumn />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RecordName}" CellStyle="{StaticResource myStyle}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RecordName}" CellStyle="{StaticResource myStyle}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=RecordName}" CellStyle="{StaticResource myStyle}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Any advice you could provide would be greatly appreciated. I'm using .NET 4.5.1 with Telerik UI for WPF Q3 2013 SP2 (13.3.1316.0) in Visual Studio 2013. Thanks!
Cheers,
Beau