RadGridView: Change color of Row selector

2 Answers 1 View
ColorEditor GridView PropertyGrid Styling
Alexander
Top achievements
Rank 1
Alexander asked on 06 May 2025, 12:07 PM | edited on 06 May 2025, 12:08 PM

Hello everybody,

in my WPF Application I am using Telerik's RadGridView. Everything is working fine so far.

But there is a little design issue, I am facing with.

In my App I am using Windows11Theme, if I use this, every row in my GridView is starting with a blue column. Sadly I am not able to find out, how to change this color.

Previously, I was using Windows8Theme and there I used "StrongColor" property to change this color. But I am not able to find out, how to change it in Windows11Theme.

Attached is an image, which shows the row, I want to change.

Thanks for your support.

BR,

Alex

2 Answers, 1 is accepted

Sort by
1
Accepted
Stenly
Telerik team
answered on 06 May 2025, 12:29 PM

Hello Alexander,

This line does not come from the row indicator, but it is the element used to freeze columns in RadGridView.

More information about this functionality can be found in the article below:

WPF DataGrid - Frozen Columns - Telerik UI for WPF

1. Hiding the frozen columns splitter element by disabling the frozen columns functionality

To remove the line, you could disable this functionality if it isn't needed on your end by setting the CanUserFreezeColumns property of RadGridView to False.

2. Changing the color of the line and keeping the frozen columns functionality

If this functionality is required, you could create a new Style that targets the FrozenColumnsSplitter element and sets its Background property to the desired value:

<Style TargetType="telerik:FrozenColumnsSplitter">
    <Setter Property="Background" Value="Red"/>
</Style>

This produced the following approach:

Additionally, once the user drags the frozen columns' splitter, it will display a blue line, which comes from the default value of a Border element from the RadGridView control's default ControlTemplate. To change it, you could subscribe to the Loaded event of the control and retrieve it via the ChildrenOfType extension method, as shown below, and modify its Background property:

private void RadGridView_Loaded(object sender, RoutedEventArgs e)
{
    RadGridView radGridView = (RadGridView)sender;

    Border frozenColumnsPreviewBorder = radGridView.ChildrenOfType<Border>().FirstOrDefault(x => x.Name == "PART_FrozenColumnsPreview");

    if (frozenColumnsPreviewBorder != null)
    {
        frozenColumnsPreviewBorder.Background = Brushes.Red;
    }
}

The produced result is as follows:

An alternative approach for changing this color would be via the Windows11Palette.Palette.AccentSelectedColor property, however, with this approach, each Telerik element that uses this color will be affected by the modification.

The following code snippet showcases this approach's implementation:

Windows11Palette.Palette.AccentSelectedColor = Colors.Red;

With this being said, I hope the provided information will be of help to you.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Alexander
Top achievements
Rank 1
answered on 06 May 2025, 12:37 PM

Hi Stenly,

that's great.

Thanks a lot for your detailed explanation. It helped me a lot.

I will keep the Freeze Column visible, it loosens up the UI a bit.

BR,

Alex

Tags
ColorEditor GridView PropertyGrid Styling
Asked by
Alexander
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or