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

Right Mouse does not display contextmenu

2 Answers 69 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 08 Aug 2011, 04:13 PM
I am using the RadTreeView control in a asp.net webform. I am trying to get the ContextMenu to display when a user clicks the right mouse. The problem I am having is that when the webform displays and the right mouse is clicked on a node, nothing happens.

However, when I place the RadTreeView in a test.aspx form, everything works OK. It only doesn't work with my webform that has a master page. 

In the code behind for my page, I run the below code to set the context menu for each node that was generated.

            foreach (RadTreeNode node in RadTreeView1.GetAllNodes())
            {
                node.ToolTip = "test tool tip -> ";
                node.ContextMenuID = "AssetMenu";
                node.EnableContextMenu = true;
            }


Here is the .aspx that defines my RadTreeView control:
<telerik:RadTreeView ID="RadTreeView1" runat="server" EnableDragAndDrop="True" OnNodeDrop="RadTreeView1_NodeDrop"
    OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick"
    OnNodeDataBound="RadTreeView1_NodeDataBound">
        <ContextMenus>
        <telerik:RadTreeViewContextMenu runat="server" ID="AssetMenu" ClickToOpen="True" Skin="Vista">
            <Items>
                <telerik:RadMenuItem Text="Select Asset" Value="Select">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="View Hierarchy" Value="View">
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadTreeViewContextMenu>
    </ContextMenus>
</telerik:RadTreeView>


Is there anything that I should be looking for in my master page that could possibly turn off the right mouse for the RadTreeView control? The tooltip is set successfully in the above code.

I have also tried assigning the contextmenu in the NodeDataBound() method without success.
What could I be missing with the contextmenu not displaying?

2 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 11 Aug 2011, 04:04 PM
Hi Jerry,

 I was not able to reproduce the problem. Could you, please, try reproducing it only by what you have provided in your previous post?

Regards,
Nikolay Tsenkov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Jerry
Top achievements
Rank 1
answered on 11 Aug 2011, 04:14 PM
The RadtreeView control was being displayed in a popup and I needed to set the z-index of the contextmenu. This solved the problem:

style="z-index:20000"

Tags
TreeView
Asked by
Jerry
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Jerry
Top achievements
Rank 1
Share this question
or