3 Answers, 1 is accepted
0
Hello Harsh,
What you are asking should be pretty straightforward. Please refer to the following articles regarding the use of context menu in WPF:
http://msdn.microsoft.com/en-us/library/ms742558(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms753329(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms752343(VS.85).aspx
Let me know if you still have problems after reading the above articles.
Best wishes,
Tihomir Petkov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
What you are asking should be pretty straightforward. Please refer to the following articles regarding the use of context menu in WPF:
http://msdn.microsoft.com/en-us/library/ms742558(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms753329(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms752343(VS.85).aspx
Let me know if you still have problems after reading the above articles.
Best wishes,
Tihomir Petkov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Harsh
Top achievements
Rank 1
answered on 05 Feb 2009, 06:24 AM
I am able to populate the contextmenu for tree but on right click on first load I do not get any contextmenu but on right click twice I get the menu. I get this problem only on forst load of the page. I have not define any contextmenu for RadTreeView in the .xaml
Code in xaml.cs:
Code in xaml.cs:
RadTreeView.ContextMenuOpening +=
new ContextMenuEventHandler(RadTreeView_ContextMenuOpening);
void RadTreeView_ContextMenuOpening(object sender, ContextMenuEventArgs e) {
RadTreeView.ContextMenu = GetContextMenu();
}
private
ContextMenu GetContextMenu() {
MenuItem objMenuItemNew, objMenuItemDelete;
ContextMenu objContextMenu = new ContextMenu();
objMenuItemNew =
new MenuItem();
objMenuItemNew.Header =
"New";
objContextMenu.Items.Add(objMenuItemNew);
objMenuItemNew.Click +=
new RoutedEventHandler(objMenuItemNew_Click);
objMenuItemDelete =
new MenuItem();
objMenuItemDelete.Header =
"Delete";
objContextMenu.Items.Add(objMenuItemDelete);
return objContextMenu;
}
0
Hi Harsh,
Please refer to the sample project I attached to the reply to your other post regarding the use of context menu in treeview.
Sincerely yours,
Tihomir Petkov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Please refer to the sample project I attached to the reply to your other post regarding the use of context menu in treeview.
Sincerely yours,
Tihomir Petkov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.