RadNavigationView colors

1 Answer 9 Views
NavigationView
Carl
Top achievements
Rank 1
Iron
Iron
Iron
Carl asked on 02 Jul 2025, 03:57 PM

RadNavigationView colors

Given the screen capture below, I'm trying to set the colors and I must be misunderstanding something.

First, I don't need ForeColor of the menu text to change to blue once I've clicked on it. 

When I click on an item (i.e. select it and make it current) it should be BackColor of Blue and ForeColor of White. I thought this would do it .but the ForeColor goes blue.

radNavigationView1.NavigationViewElement.SelectedItem.BackColor = Color.Blue;
radNavigationView1.NavigationViewElement.SelectedItem.ForeColor = Color.White;

Then , when I hover the mouse pointer over a menu item (as I'm doing with Electronic Payments & Finding) it should be BackColor of Greay and ForeColor of Black. I'm trying to set it in SelectedPageChanging.

A screenshot of a contact form  AI-generated content may be incorrect.

What am I doing wrong?

Carl

 

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 03 Jul 2025, 07:01 AM

Hello, Carl,

To achieve your requirements, I would recommend you use the SetThemeValueOverride() and override theme settings at run time. This method is very useful in scenarios like yours, where you need to style a specific element state without losing the applied style for the rest of the states. More information about how to use it is available here: Override Theme Settings at Run Time - Telerik Presentation Framework - Telerik UI for WinForms

Based on your requirements, I prepared a code snippet with the desired colors. Feel free to customize the items further according to your specific needs.

foreach (RadPageViewItem item in this.radNavigationView1.NavigationViewElement.Items)
{
  // override Selected state
item.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.BackColorProperty, Color.LightBlue, "RadPageViewNavigationViewItem.Selected");
    item.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.ForeColorProperty, Color.White, "RadPageViewNavigationViewItem.Selected");
    
//override MouseOver state
item.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.BackColorProperty, Color.Gray, "RadPageViewNavigationViewItem.MouseOver");
    item.SetThemeValueOverride(Telerik.WinControls.Primitives.FillPrimitive.ForeColorProperty, Color.Black, "RadPageViewNavigationViewItem.MouseOver");
}

I hope this helps. If you have any other questions, do not hesitate to contact me.

Regards,
Nadya | Tech Support Engineer
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.

Tags
NavigationView
Asked by
Carl
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or