Hi Sir,
i am working with Navigationview.in this , i have to show different page while clicking menus.for that i created usercontrol.and stored usercontol page name in database.now how to bind that name in content.can user id for reference.give solution sir.
3 Answers, 1 is accepted
Hello Vidhya,
To achieve your requirement, you can use the SelectionChanged event of RadNavigationView. Each time you select a RadNavigationViewItem, the event fires and in the event handler you can get the UserControl that should be displayed and assign it to the Content property of RadNavigationView.
Similar approach, but with data binding to the SelectedItem of RadNavigationView is shown in the First Look demo of the control.
Can you try those suggestions and let me know how it goes?
Regards,
Martin Ivanov
Progress Telerik
Hello Martin,
Can you please give us some example to do this using selected item with content region of PRSIM in MVVM pattern. The example you pointed out is very basic example and we want to navigate to different view in content region each time menu is clicked using MVVM pattern.
Kindly help as we are also struck in this from few days.
Hello Vidhya,
We do not have a PRISM example, but whatever framework do you use, the basic idea will be the same - when the SelectedItem of RadNavigationView changes, its Content should get updated. The means of listening for selection change are the SelectionChanged event and the SelectedItem setter if using MVVM. And changing the content is done via the Content property of RadNavigationView. The exact approach how those will be used is up to the concrete application requirements or third party framework specifics (like in PRISM).
Anyway, I've created a small example using Prism and RadNavigationView. I hope this helps.
Regards,
Martin Ivanov
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).