Contact Sales: +1-888-365-2779
Community & Support
Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Treeview > Dynamic context menu contents..
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Dynamic context menu contents..

Feed from this thread
  • ian leicht avatar

    Posted on Jul 14, 2005 (permalink)

    I am implementing a copy/paste system on my treeview. My treeview consists of categories and items.

    If you copy an item to the clipboard (via a context menu: Copy), you should be able to right click on a category node and paste (via a context menu: Paste) the entry.

    If you copy a category to the clipboard (via a context menu: Copy) you can then either paste a copy of the category (i.e. in the underlying database I will duplicate all of the child nodes) or paste a link/shortcut/alias to the category.

    In other words, I want to vary the context menu that displays on category nodes based upon the type of the node that is in the clipboard.

    Option A: I imagine that I could do this by creating two different context menus for categories and then looping through all of the nodes and converting them from one type to the other server side, but that sounds inefficient and will require a decent amount of coding to implement.

    Option B: I believe that I read that it is possible to dynamically modify context menus server-side. I haven't tried this, but does this mean that I could just make the modification server-side when the user copies and it will go into effect?

    Option C: I was hoping I could instead do this client side and somehow intercept an event right before the context menu is drawn and then modify the context menu at that time...

    Suggestions?

  • Sebastian Sebastian admin's avatar

    Posted on Jul 15, 2005 (permalink)

    Hello Ian,

    Indeed you can customize the context menus of r.a.d.treeview server side  - please review the following KB article which represents how you can build context menus on the server. You can check the type of the saved copy (whether it is item or category) and construct the context menu with regards to your custom requirements.
    Another option is the one you mentioned first - creating static context menus, traversing the nodes and setting their ContextMenuName property when needed (which will take greater amount of time and coding).
    You may choose the better approach for you from these options - hope the provided information helps.
     
    Best,
    Stephen, the telerik team

  • ian leicht avatar

    Posted on Jul 15, 2005 (permalink)

    FYI, I took a stab at Option B (using the contextmenus)... it worked out fine.

  • rivgi avatar

    Posted on Jun 24, 2007 (permalink)

    mnkmb

  • rivgi avatar

    Posted on Jun 24, 2007 (permalink)

    mnkmb

  • rivgi avatar

    Posted on Jun 24, 2007 (permalink)

    rararara

  • Posted on Oct 30, 2009 (permalink)

    Hi,
    do you have a new link for http://www.telerik.com/Default.aspx?PageId=2514&b454K=CbB&b454T=flx ?

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Treeview > Dynamic context menu contents..