This is a migrated thread and some comments may be shown as answers.

Role based Menus

1 Answer 137 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Rana
Top achievements
Rank 1
Rana asked on 05 Sep 2012, 11:31 AM
I am new to WPF, The scenerio is that i am Developing the application in WPF and i have made the menu.XML file which is a datasource for Ribbon Control. Now i want to hide/Disbale the menu on the basis of user role, User role is defined in Dataabse, Lets if user is Manager then he will only see Requests Tab and similarly if admin has logged in then he might only be able to see requests tab and Admin Tab also.

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 10 Sep 2012, 01:17 PM
Hello Rana,

I am not really sure how your data is organized, but it would be best if you can change the ItemsSource of the RadRibbonView based on the current user role. This means that for each user type, there should be a different collection of items to be displayed in the RibbonView.

If you can't implement this approach in your application, you can try binding the Visibility property of the RadRibbonTabs to a business property - the user role for example. You can define a custom converter to define the Visibility based on your logic:
<Style TargetType="telerik:RadRibbonTab">
 <Setter Property="Visibility" Value="{Binding UserRole, Converter={StaticResource MyCustomVisibilityConverter}}" />
</Style>

Still, in a databinding scenario, it's much better to change the entire ItemsSource collection rather than collapsing certain tabs.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Menu
Asked by
Rana
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or