Hello Telerik,
Here is the style:
<Window.Resources>
<Style TargetType="telerik:GridViewColumn">
<Setter Property="HeaderTextAlignment" Value="Center"/>
</Style>
</Window.Resources>
And here is the grid:
<telerik:RadGridView Name="radGridScenario" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserFreezeColumns="False" IsFilteringAllowed="False" ShowGroupPanel="False" AutoGenerateColumns="False" >
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding BusName}" UniqueName="BusName" Header="Bus Name" Width="100" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Observe the style is not working and the column is left centered (default behaviour). To make it working I have to create a named style and assign this style by key to every column. Why can't I create a global default style for all the columns automatically?
Just in case somebody wants to point out that I should create style for GridViewDataColumn (instead of GridViewColumn) my answer is that GridViewDataColumn is derived from GridViewColumn and even if I do that in the style definition it's stil not working.
If I apply the same technique to other grid properties, for example to center check box then it is working.
Thanks,
Cezar