[Solved] RadNavigationView hierarchical items lose expanded state after runtime theme change.

1 Answer 4 Views
NavigationView (Hamburger Menu)
Dodd
Top achievements
Rank 1
Dodd asked on 19 Jun 2026, 05:23 AM
I am building a NavigationView project where users can switch between multiple themes at runtime.

The NavigationView contains 5 navigation items in total, and 2 of them have hierarchical child items.

The initial theme works correctly.  
However, after running the application, if I select a child item in the hierarchy, for example `Products > Categories`, and then change the theme while that view is active, some issues occur.

The issues I observed are:

1. `RadNavigationView.SelectedItem` still appears to point to the child item `Categories`, but in the UI, the parent item appears collapsed, as if all expanded states were closed.
2. If issue 1 is resolved manually, the user may be able to click the item again with the mouse. However, I suspect that changing the theme with the keyboard arrow keys in the Theme ComboBox may behave differently from selecting a theme with the mouse.

I could not find a Telerik demo that shows how to handle runtime theme switching with a hierarchical `RadNavigationView`.

Could you help identify the cause of this behavior?  
Also, is there a recommended approach for preserving the selected item, expanded state, and item styles when changing themes at runtime in a hierarchical `RadNavigationView`?

I have attached a sample project. The license key has been removed.

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 19 Jun 2026, 02:25 PM

Hello, Dodd,

Thank you for providing a sample project that can demonstrate your current setup. I was able to revise it and would like to come up with the following thoughts:

The root cause of issue 1 is that RadNavigationViewItem.IsExpanded is not data-bound; when the ItemContainerStyle is swapped via DynamicResource, containers are regenerated with IsExpanded=false.

The root cause of issue 2 is that after the visual tree rebuild, the control needs a deferred reapplication of SelectedItem to visually highlight the child item again.

To resolve these, you should make the NavigationItem class observable so the IsExpanded property can notify the UI. I'll change it to derive from ObservableObject (already used in the project via CommunityToolkit.Mvvm):

Then add the IsExpanded property to NavigationItem (backed by ObservableObject) and bind it TwoWay in the ItemContainerStyle. This persists in the expanded state in the model so it survives container regeneration. Then, in MainViewModel, listen to ThemeChanged and use Dispatcher.BeginInvoke to reset SelectedNavigationItem after the visual tree rebuilds, ensuring the selection visual is restored. This also resolves the keyboard issue because each theme change (whether from mouse or keyboard) will properly restore state.

I updated the provided project with recent changes, so you can download it locally on your side and inspect how it works now. 

I hope this information helps. If you have other questions, please let me know.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Unlock smarter data exploration in RadGridView with AI-powered features. Enable natural language queries and help users uncover insights faster.

Learn more about RadGridView AI features

Tags
NavigationView (Hamburger Menu)
Asked by
Dodd
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or