RadContextMenu in RadTreeListView

4 posts, 0 answers
  1. Adriano
    Adriano avatar
    43 posts
    Member since:
    Jan 2009

    Posted 20 May 2010 Link to this post

    Hi, is it possible to attach a RadContextMenu on a RadTreeListView? Because we tried to follow the instructions of the RadTreeView sample but with no success.

    Best regards
    Adriano
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 25 May 2010 Link to this post

    Hi Adriano,

    What example are you following?

    If the context menu there is part of the ItemTemplate of the TreeView it will indeed not work for the TreeList because the ItemTemplate in the TreeList appears as a details view for the items.

    You can assign one context menu for the whole TreeList and find the item that has been clicked in the Opened event:

    private void OnMenuOpened(object sender, RoutedEventArgs e)
    {
        var row = contextMenu.GetClickedElement<RadTreeListViewItem>();
        if (row != null)
        {
            var dataItem = row.Item;
        }
    }

    And the xaml:

    <telerikNavigation:RadContextMenu.ContextMenu>
        <telerikNavigation:RadContextMenu x:Name="contextMenu" Opened="OnMenuOpened">
            <telerikNavigation:RadMenuItem Header="Action 1" />
            <telerikNavigation:RadMenuItem Header="Action 2"/>
        </telerikNavigation:RadContextMenu>
    </telerikNavigation:RadContextMenu.ContextMenu>

    Hopefully this will help you,

    Best wishes,
    Miroslav
    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. DevCraft banner
  4. Gili
    Gili avatar
    14 posts
    Member since:
    Jan 2013

    Posted 21 May 2013 Link to this post


    Hi, is it possible to attach a RadContextMenu on a RadTreeListView? 
    Because we tried to follow the instructions of the RadTreeView sample but with no success.



    I tried the solution and got an error  RadTreeListViewItem  does not exist  .
    i can see it is an old (thread) question 
    but i have the same question now. 
    so how can i do it ? 
    thank you



     
  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 21 May 2013 Link to this post

    Hello Gili,

    Please find attached a sample project which meets your
    requirements.

    If you need further assistance on this, do not hesitate to contact us again!

    Regards,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top