Working with two context menu

3 posts, 0 answers
  1. Ilyhel
    Ilyhel avatar
    3 posts
    Member since:
    Dec 2011

    Posted 12 Aug 2014 Link to this post

    Hi , 
    I have 2 context menu in my Tree View  in the client side i want to specify wich one i want to use its seem the tree view get the first one as default menu.i use the same code in demo.

    <ContextMenus>
        <telerik:RadTreeViewContextMenu ID="ArtclesMenu" runat="server">
                        <Items>
                            <telerik:RadMenuItem 
                                Value="NewArticle"
                                 Text="New Article" 
                                ImageUrl="~/TreeView/Img/Outlook/12.gif">
                            </telerik:RadMenuItem>
                          
                        </Items>
                        
                    </telerik:RadTreeViewContextMenu>
                    <telerik:RadTreeViewContextMenu ID="MainMenu" runat="server">
                        <Items>
                            <telerik:RadMenuItem Value="AddChapter" Text="Add Chapter">
                            </telerik:RadMenuItem>
                             <telerik:RadMenuItem Value="Delete" Text="Delete" >
                            </telerik:RadMenuItem>
                            
                           </Items>
                        </telerik:RadTreeViewContextMenu>
     
    </ContextMenus>    
         



  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Aug 2014 in reply to Ilyhel Link to this post

    Hi  Ilyhel,

    Try to set the ContextMenuID property of RadTreeNode based on your requirement as follows.

    ASPX:
    ...
    <
    Nodes>
        <telerik:RadTreeNode Text="Node1" ContextMenuID="ArtclesMenu">
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node2" ContextMenuID="MainMenu">
        </telerik:RadTreeNode>
    </Nodes>
    ...

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ilyhel
    Ilyhel avatar
    3 posts
    Member since:
    Dec 2011

    Posted 12 Aug 2014 in reply to Princy Link to this post

    Thank you for your response :) i set the node contextMenuID in the client side a nd it works well.
    node.set_contextMenuID("MainMenu"); 
Back to Top