Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
329 views

How do I access the TreeView COntext from the TReeViewItem Context Menu?

I have a tree view which lists the drives & folders in the PC. I am working in MVVM with Micrososft MVVM Toolkit, Fody and Microsoft Behaviors. I have a Folder Tree view model for PC which creates ...
Thepointyman's user avatar
1 vote
1 answer
101 views

Opened ContextMenu -> RightClick triggers LeftClickCommand in ViewModel

I have a ContextMenu bound to an HierarchicalDataTemplate that displays a TreeView structure. The ContextMenu also is a HierarchicalDataTemplate that obtains its structure through an ...
Chris's user avatar
  • 855
1 vote
1 answer
723 views

Caliburn.micro get treeview's selected item by contextmenu onclick

I have a task to use a contextmenu in treeview and pass selected treeview's item to ViewModel by clicking on contextmenu element. Here is my xaml: <Window.Resources> <...
whizzzkey's user avatar
  • 946
0 votes
1 answer
691 views

WPF TreeView context menu is disabled if no items exist

I am trying to show a ContextMenu in a TreeView. Some entries must be available whether an item was selected or not, but all commands are disabled until I populate the TreeView with at least one item: ...
just.me's user avatar
  • 2,285
2 votes
2 answers
881 views

Send a reference to a parent object from a context menu

I am using C# and WPF and I have no idea how to accomplish the following: I have a TreeView, which contains TreeViewItems. In every TreeViewItem.Header, there is a Stack Panel which contains an icon, ...
chincheta73's user avatar
1 vote
2 answers
1k views

How do I force a context menu to be loaded? [closed]

I have a wpf application that has a TreeView in it. The TreeView has a context menu. The context menu only starts loading after I right click on one of the TreeViewItems. (How I know this - I added a ...
Maya S's user avatar
  • 147
0 votes
0 answers
82 views

ContextMenu only on specific TreeViewItem

Is there any possible solution to show custom ContextMenu on specific TreeViewItem? My TreeView looks like that: <TreeView Name="AliasTree" ItemsSource="{Binding aliases}"> <TreeView....
Wiktor's user avatar
  • 856
0 votes
3 answers
609 views

WPF prevent TreeViewItem to inherit contextMenu from parent by code

I have the following code and I set explicite the ContextMenu from a TreeViewItem to null but it shows all the time the same ContextMenu as the treeviewitem parents! Is that a bug? and how can I solve ...
user5514770's user avatar
1 vote
1 answer
5k views

WPF MVVM Add dynamic context Menu for TreeView using code C# in View Model

I have a TreeView created using HierarchicalDataTemplate with help of this famous article. Each node in my treeview has a different contextMenu. So I created a property for treeView that return for ...
xtensa1408's user avatar
1 vote
1 answer
2k views

TreeView add different context Menu to every item in the same level, WPF MVVM

With the help of this article, I created TreeView by using WPF with MVVM. Now I want to add different context menu to every items in the one level. A google research allows me to create a same context ...
xtensa1408's user avatar
0 votes
2 answers
381 views

Method in ContextMenu for (Hierarchical)DataTemplate calls TreeViewItem's method instead of the one in ViewModel

I have a TreeView with multiple HierarchicalDataTemplate & DataTemplate items and I'm using Caliburn Micro for mvvm. The ItemsSource for the treeview is pointing to a collection in the viewmodel ...
Jeankes's user avatar
  • 169
0 votes
1 answer
1k views

wpf treeview xaml context menu click event not firing

for some reason unbeknownst to me I have been having some trouble getting this click event firing from the context menu of a datasourced treeviewitem. The context menu appears as expected but is not ...
xxdefaultxx's user avatar
1 vote
1 answer
2k views

Disable TreeView context menu items when nothing is selected in the TreeView from XAML

I am trying to disable certain menu items in a treeview's context menu if the SelectedItem property for the treeview is null. My expectation is that this would be most simple to achieve by binding ...
Mick Waites's user avatar
2 votes
1 answer
2k views

Add context menu on right click. [closed]

public void mytree() { DatabaseCore db = new DatabaseCore(); List<allTreeView> myList = new List<allTreeView>(); DataTable dt = db.FillDataGrid(); foreach (DataRow row in ...
Striker's user avatar
  • 958
0 votes
1 answer
794 views

WPF TreeViewItem ContextMenu

In other questions/answers about putting ContextMenu on TreeView elements I always see a reference to TreeView.ItemTemplate. This is great when you want the same menu for all items, What if I want ...
ILIA BROUDNO's user avatar
  • 1,893

15 30 50 per page