Hi,
We are using Telerik Controls for Silverlight.
We need to disable some of the Context menu items based on some property value.
I see some sample where we can loop through the RadMenuItems and can set the IsEnable property.
But in our case we are using "HierarchicalDataTemplate" to load data dynamically using MVVM.
Following is the code.
I am trying to handle this in the ContextMenu opened event, but there I am not able to find "RadMenuItem" from the collection.
Please help!!!
Regards,
SivaPrasad.B
We are using Telerik Controls for Silverlight.
We need to disable some of the Context menu items based on some property value.
I see some sample where we can loop through the RadMenuItems and can set the IsEnable property.
But in our case we are using "HierarchicalDataTemplate" to load data dynamically using MVVM.
Following is the code.
<
telerik:HierarchicalDataTemplate
x:Key
=
"MenuItemTemplate"
ItemsSource
=
"{Binding Employees}"
>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
telerik:HierarchicalDataTemplate
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
x:Name
=
"cMnuErrorMenu"
ItemClick
=
"rcmErrorMenu_ItemClick"
Opened
=
"cMnuErrorMenu_Opened"
ItemsSource
=
"{Binding Employees}"
ItemTemplate
=
"{StaticResource MenuItemTemplate}"
Height
=
"{Binding Res_Paths_ContextMenu_Height}"
Width
=
"380"
>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
I am trying to handle this in the ContextMenu opened event, but there I am not able to find "RadMenuItem" from the collection.
Please help!!!
Regards,
SivaPrasad.B