Add Context Menu To TreeView

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    17 posts
    Member since:
    Feb 2011

    Posted 29 Apr 2011 Link to this post

    I want to add a simple context menu to a treeview. So far I have

    <telerik:RadTreeView ItemsSource="{Binding Customers}">
      
        <telerik:RadContextMenu.ContextMenu>
            <telerik:RadContextMenu>
                <telerik:RadMenuItem Header="New" />
                <telerik:RadMenuItem Header="Open"/>
                <telerik:RadMenuItem Header="Delete" />
            </telerik:RadContextMenu>
        </telerik:RadContextMenu.ContextMenu>
    </telerik:RadTreeView>

    When I run it and right-click the treeview, I get nothing. There is no data, so there are no nodes, but that shouldn't matter - how would the user selected the New option?


  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 03 May 2011 Link to this post

    Hi Kevin,

    I am unable to reproduce your issue in our environment. What is the panel/control that holds your RadTreeView ? Could you please check out the attached project where a blank tree is placed in Grid (you can remove the Grid and test again) ? The RadContextMenu appears fine when right clicking with the mouse.
    Please let us know if we are missing something.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top