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

RadGridView Header BackGroundColor

12 Answers 337 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mehmet
Top achievements
Rank 1
Mehmet asked on 29 Jul 2012, 01:21 PM

Hi,

I changed RadGridView BackGroundColor with some XAML codes.
But I couldn't change first header column, as the picture Image.
What should I do?

Mehmet,
Regards

 My code;
 <LinearGradientBrush x:Key="a1" StartPoint="0.5,0" EndPoint="0.5,0.5">
            <GradientStop Offset="1" Color="Gray" />
            <GradientStop Offset="0" Color="#FFD8D8D8" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="GridView_HeaderOuterBorder" Color="#FF848484"/>
        <Style TargetType="telerik:GridViewHeaderRow">
            <Setter Property="Background" Value="{StaticResource a1}"/>
        </Style>
        <Style TargetType="telerik:GridViewHeaderCell">
            <Setter Property="Background" Value="{StaticResource a1}"/>
        </Style>
        <Style TargetType="telerik:GridViewAggregateResultCell">
            <Setter Property="Background" Value="{StaticResource a1}"/>
        </Style>

12 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 30 Jul 2012, 07:30 AM
Hello,

The first part for the header row is presented by the "Part_IndicatorPresenter" border. Please check the visual structure for the indent cells of the GridView and style all the relevant elements.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mehmet
Top achievements
Rank 1
answered on 30 Jul 2012, 08:48 AM
Hi Didie,

I tried again
but I can't change this section. 
I'm sending my problem as the picture Image.

Allt the best
Mehmet
0
Dimitrina
Telerik team
answered on 30 Jul 2012, 10:57 AM
Hi,

 The element that you have marked  is "GridViewHeaderIndentCell". To change its Background you should create a simple style targeting this element.

<Style TargetType="{x:Type GridViewHeaderIndentCell}">
   <Setter Property="Background" Value="{StaticResource a1}"/>
</Style>


All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mehmet
Top achievements
Rank 1
answered on 30 Jul 2012, 12:33 PM

Hi Didie ,

note: I used hieararchy a grid. I sent you as the first Image,
at the same time, Your example maybe WPF "x:Type"?

I tried before this element, but problem has not changed.

<Style TargetType="telerik:GridViewHeaderIndentCell">
   <Setter Property="Background" Value="{StaticResource a1}"/>
</Style>

your code;

<Style TargetType="{x:Type GridViewHeaderIndentCell}">
<Setter Property="Background" Value="{StaticResource a1}"/>
</Style>

 

All the best,
Mehmet

0
Dimitrina
Telerik team
answered on 30 Jul 2012, 01:02 PM
Hello,

 Indeed, you are right - my code snippet was for WPF. Please excuse me for my mistake.

It seems that you cannot change the Background with a simple style as it is internally set to be the "GridView_HeaderRowBackground". You have to edit the template of GridViewHeaderIndentCell directly and change its background from there. Please give it a try and let me know if you will need a sample project?

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Mehmet
Top achievements
Rank 1
answered on 30 Jul 2012, 01:35 PM
Hi Didie ,

Yes please, I need a sample project.

Thanks
Mehmet
0
Dimitrina
Telerik team
answered on 30 Jul 2012, 02:15 PM
Hi,

 I have discussed the case with our front-end developer and I have some very good news. The problem with setting the Background in a simple style has been resolved. The fix will be available within the latest internal build that is expected to be released later today. 

Then this code will colour the HeaderIndentCell Pink:

<Style TargetType="telerik:GridViewHeaderIndentCell">
    <Setter Property="Background" Value="Pink"/>
</Style>

Please wait for the LIB and let me know about the results once you test it.
 

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Richard
Top achievements
Rank 1
answered on 22 Dec 2014, 11:26 PM
Hello Dimitrina,
I am familiar with your answer of Style and TargetType but I don't understand how to access that "indent" in (WPF) XAML. I use a similar style to change the column header backgrounds.

This changes the column headers but not the "indent"...

              <telerik:GridViewDataColumn Header="Updated By" DataMemberBinding="{Binding Property.UpdatedBy}"       HeaderCellStyle="{StaticResource HeaderStyle}" Width="200" TextAlignment="Left" />
              

How do I change the indent column header background???

Thank you,
Richard Howes

0
Vanya Pavlova
Telerik team
answered on 23 Dec 2014, 08:28 AM
Hello Richard,


Thank you for contacting us.

You may define an implicit style targeted at GridViewHeaderIndentCell, as proposed in our online documentation here. 


Regards,
Vanya Pavlova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Richard
Top achievements
Rank 1
answered on 23 Dec 2014, 01:49 PM
Thank you. 
0
Richard
Top achievements
Rank 1
answered on 23 Dec 2014, 01:50 PM
I don't have access to Blend. What does the XAML look like that is chopped off in that image? Thanks again!
0
Vanya Pavlova
Telerik team
answered on 23 Dec 2014, 02:01 PM
Hello Richard,


You could check the XAML mark-up, referred by my colleague, here. 


Regards,
Vanya Pavlova
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Mehmet
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Mehmet
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or