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
RadPanelBar for Silverlight.UserControl.Resources and referred to it through ItemTemplate of RadPanelBar.BindingProperties.SelectedTemplate.Charts. I am unable to generate the content of the RadPanelBarItem. What ever I do I either get the content in the header of the item or will not get any content generated.BindingProperties.SelectedTemplate is an entity and Charts is a list of objects.<UserControl.Resources> <telerik:HierarchicalDataTemplate x:Key="ChartDetailView">
<StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" > <Button Width="25" Height="25" Margin="10,0,0,0"> <Image Source="Resources/DeleteRed.png" HorizontalAlignment="Stretch" VerticalAlignment="Top" /> </Button> <Views:ChartConfigView VerticalAlignment="Top" Grid.ColumnSpan="2" /> </StackPanel> </telerik:HierarchicalDataTemplate> <telerik:HierarchicalDataTemplate x:Key="ChartView" ItemsSource="{Binding}" ItemTemplate="{StaticResource ChartDetailView}"> <TextBlock Text="{Binding Path=ChartTitle}" Margin="5 3" /> </telerik:HierarchicalDataTemplate> </UserControl.Resources><telerik:RadPanelBar telerik:StyleManager.Theme="Vista" ItemsSource="{Binding Path=BindingProperties.SelectedTemplate.Charts}" ItemTemplate="{ StaticResource ChartView}" ></telerik:RadPanelBar>