Working with two context menu

4 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. 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"); 
  4. Mrityunjay
    Mrityunjay avatar
    2 posts
    Member since:
    Apr 2017

    Posted 07 Apr in reply to Ilyhel Link to this post

    Hi

    This is my Code

    <telerik:RadTreeViewContextMenu ID="ContextmenuExapnCollapse" runat="server" clientidmode="Static">
                                                    <Items>
                                                        <telerik:RadMenuItem Value="ExpandAll" Text="Expand All">
                                                        </telerik:RadMenuItem>
                                                        <telerik:RadMenuItem Value="CollapseAll" Text="Collapse All">
                                                        </telerik:RadMenuItem>
                                                    </Items>
                                                </telerik:RadTreeViewContextMenu>

     

     var node = new Telerik.Web.UI.RadTreeNode();

    node.set_contextMenuID("ContextmenuExapnCollapse"); 

     

    i am setting Context Menu like this but its not working can you please help me out

     

     

  5. Mrityunjay
    Mrityunjay avatar
    2 posts
    Member since:
    Apr 2017

    Posted 07 Apr in reply to Princy Link to this post

    Hi
    This is my Code
    <telerik:RadTreeViewContextMenu ID="ContextmenuExapnCollapse" runat="server" clientidmode="Static">
                                                    <Items>
                                                        <telerik:RadMenuItem Value="ExpandAll" Text="Expand All">
                                                        </telerik:RadMenuItem>
                                                        <telerik:RadMenuItem Value="CollapseAll" Text="Collapse All">
                                                        </telerik:RadMenuItem>
                                                    </Items>
                                                </telerik:RadTreeViewContextMenu>

     var node = new Telerik.Web.UI.RadTreeNode();
    node.set_contextMenuID("ContextmenuExapnCollapse"); 

    i am setting Context Menu like this but its not working can you please help me out
Back to Top