This is a migrated thread and some comments may be shown as answers.

Working with two context menu

4 Answers 85 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ilyhel
Top achievements
Rank 1
Ilyhel asked on 12 Aug 2014, 09:15 AM
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>    
     



4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Aug 2014, 09:33 AM
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.
0
Ilyhel
Top achievements
Rank 1
answered on 12 Aug 2014, 01:39 PM
Thank you for your response :) i set the node contextMenuID in the client side a nd it works well.
node.set_contextMenuID("MainMenu"); 
0
Mrityunjay
Top achievements
Rank 1
answered on 07 Apr 2017, 11:03 AM

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

 

 

0
Mrityunjay
Top achievements
Rank 1
answered on 07 Apr 2017, 11:04 AM
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
Tags
TreeView
Asked by
Ilyhel
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ilyhel
Top achievements
Rank 1
Mrityunjay
Top achievements
Rank 1
Share this question
or