Hi!
I've a Tree, that has a RadContextMenu(Telerik's version of Context Menu). On every ItemMenu, I've an action.
I need to know, on which element of my Tree i've right clicked. How can I do this?
I tried to use the "SelectItem", but it seems the tree doesn't select on right click.
Thank you!
I've a Tree, that has a RadContextMenu(Telerik's version of Context Menu). On every ItemMenu, I've an action.
I need to know, on which element of my Tree i've right clicked. How can I do this?
I tried to use the "SelectItem", but it seems the tree doesn't select on right click.
Thank you!
<Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.Resources><HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding SubNodes}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Name}"/> </StackPanel> </HierarchicalDataTemplate> </Grid.Resources><telerik:RadTreeView Name="uxRadTreeView" ItemsSource="{Binding RootFolder.SubNodes}" ItemTemplate="{StaticResource NodeTemplate}" AllowDrop="False" IsDragDropEnabled="True" DragEnded="uxRadTreeView_DragEnded" MouseRightButtonUp="uxRadTreeView_MouseRightButtonUp"> <telerik:RadContextMenu.ContextMenu> <telerik:RadContextMenu IsEnabled="{Binding MainTree.CurrentItem.IsFolder, Mode=OneWay}" > <telerik:RadMenuItem Header="Create new folder" Icon="/GuiResources;component/ActionsIcons/newFolder.png" Click="NewFolder" /> <telerik:RadMenuItem Header="Create new file" Icon="/GuiResources;component/ActionsIcons/newFile.png" Click="NewFile"/> <telerik:RadMenuItem Header="Add a new version of this file" Icon="/GuiResources;component/ActionsIcons/newFileVersion.png" Click="NewFileVersion"/> <telerik:RadMenuItem Header="Delete" Icon="/GuiResources;component/ActionsIcons/delete.png" Click="Delete"/> </telerik:RadContextMenu> </telerik:RadContextMenu.ContextMenu> </telerik:RadTreeView> </Grid>