3 Answers, 1 is accepted
0
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:
And the xaml:
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.
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.
0
Gili
Top achievements
Rank 1
answered on 21 May 2013, 06:09 AM
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
0
Hello Gili,
Please find attached a sample project which meets your requirements.
Yoan
the Telerik team
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.