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
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.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
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.
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
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?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Yes please, I need a sample project.
Thanks
Mehmet
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.
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
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.
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.