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

Inheriting style in GridViewHeaderCell

1 Answer 149 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Deepak N
Top achievements
Rank 1
Deepak N asked on 13 Aug 2009, 08:03 AM
Hi ,

I am not able to inherit/override style for telrik:GridViewHeaderCell

 I have Common ResourceDictionary  Style.Xaml , it has

<ResourceDictionary xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Style TargetType="telerik:GridViewHeaderCell">
        <Setter Property="FontWeight" Value="ExtraLight" />
        <Setter Property="FontStyle" Value="Normal" />
    </Style>
</ResourceDictionary>

Im MyControl.Xaml I have

  <Window.Resources>
        <Style x:Key="CheckBoxHeaderCellStyle"  TargetType="telerik:GridViewHeaderCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:GridViewHeaderCell">
                        <CheckBox HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    
In code behind I am using

 var dict = new ResourceDictionary
                           {
                               Source = new Uri("MyApp;component/View/styles.xaml", UriKind.Relative)
                           };
Resources.MergedDictionaries.Add(dict);

I apply style in GridDataColumn as

<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource CheckBoxHeaderCellStyle}"/>

In design mode I can see the checkbox in Grid Header.But It does not show a check box in GridHeader.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 19 Aug 2009, 07:26 AM
Hi Deepak N,

I've just tried this however everything worked fine - you can check the attached project.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Deepak N
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or