Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Reset ContextMenu options after ContextMenuOpening

$
0
0

Hello,

I have a RadTreeView with a context menu showing different options depending on the node level. However, I need to reset the context menu after ContextMenuOpening because once a menu item is removed from the context menu it doesn't display again.

 

01.voidradTreeEmployers_ContextMenuOpening(objectsender, Telerik.WinControls.UI.TreeViewContextMenuOpeningEventArgs e){
02.    if(e.Node.Level == 1 || e.Node.Level == 2)
03.    {
04.        for(inti = 0; i <= e.Menu.Items.Count - 1; i++)
05.        {
06.            if(e.Menu.Items[i].Name == "addEmployer")
07.                e.Menu.Items.Remove(e.Menu.Items[i]);
08.        }
09.    }
10.}

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>