Click here to Skip to main content
15,894,284 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI
I want to apply style for columnheader of row header ... but its nt working .
just working on the styles of row header .. but nt work for columnheader of row header.

<Style x:Key="DataGridStyle" TargetType="local:DataGridRowGroupHeader">
<setter property="Background" value="black">
</Style>
Posted
Updated 23-Mar-11 2:37am
v3
Comments
Sandeep Mewara 23-Mar-11 6:36am    
Not clear. Please edit and update on what are you trying to do with the issue faced.

Are you trying to style the DataGridRowGroupHeaders?

If so, something like this (taken from the DataGrid.RowGroupHeaderStyles documentation)...

XML
<sdk:DataGrid.RowGroupHeaderStyles>
    <!-- Style for groups at top level -->
    <Style TargetType="sdk:DataGridRowGroupHeader">
    </Style>
    <!-- Style for groups under the top level -->
    <!--
    <Style TargetType="sdk:DataGridRowGroupHeader">
        <Setter Property="Background" Value="#44225566" />
    </Style>
    -->
</sdk:DataGrid.RowGroupHeaderStyles>
 
Share this answer
 
Modify TopLeftHeaderTemplate to change that.

XML
<!--Start: TopLeftHeaderTemplate-->
                                        <ControlTemplate x:Key="TopLeftHeaderTemplate" TargetType="localprimitives:DataGridColumnHeader">
                                            <Grid Name="Root">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition/>
                                                    <RowDefinition Height="Auto" />
                                                </Grid.RowDefinitions>
                                                <Border BorderThickness="0,0,1,0" BorderBrush="#FFC9CACA" Background="#FF1F3B53" Grid.RowSpan="2">
                                                    <Rectangle Stretch="Fill" StrokeThickness="1">
                                                        <Rectangle.Fill>
                                                            <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
                                                                <GradientStop Color="Yellow" Offset="0.015" />
                                                                <GradientStop Color="Yellow" Offset="0.375" />
                                                                <GradientStop Color="Yellow" Offset="0.6" />
                                                                <GradientStop Color="Yellow" Offset="1" />
                                                            </LinearGradientBrush>
                                                        </Rectangle.Fill>
                                                    </Rectangle>
                                                </Border>
                                                <Rectangle VerticalAlignment="Bottom" Width="Auto" StrokeThickness="1" Height="1" Fill="#FFDBDCDC" Grid.RowSpan="2"/>
                                            </Grid>
                                        </ControlTemplate>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900