Hi,
Im trying to get a context menu working with a tree node, when you right click i need to get the click on node details on the server side. im able to get the UltraWebMenu selected item so i can tell when menu was selected but im unable to get the node that was selected from the tree.
Kind Regards
Ste
Hi Ivan,
In the above case, UltraWebTree1.SelectedNode returns a Node object provided the node is selected first (by left click). If i directly do a right click on a tree node and select a context menu item, UltraWebTree1.SelectedNode returns a null object reference. In this context, to find out the selected node, i need to write a lot of code which will only be a work around but not the solution.
Please help me in this regard if there is any way by which i can directly get hold of the the node.
Thanks in advance,
-SGopaluni
Hello,
You can use the server -side event MenuItemClicked of UltraWebMenu and manipulate the UltraWebTree, you can see below how the event is implemented:
protected void UltraWebMenu1_MenuItemClicked(object sender, Infragistics.WebUI.UltraWebNavigator.WebMenuItemEventArgs e)
{
if (e.Item.Text == "Get Text")
Label1.Text = UltraWebTree1.SelectedNode.Text;
}
if (e.Item.Text == "Hide Now")
UltraWebTree1.SelectedNode.Hidden = true;
Also you can take a look at that link:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=4858
Hope this helps.
Thanks for the reply, Ive looked at these samples before and they only show how to implement the popup menu control it doesnt show how to do the server side interaction between the UltraTree and the UltraWebMenu, none of the menus have working functions. It would really help if the samples showed the functions actually working.
Cheers
Please, look at that sample:
https://ko.infragistics.com/samples/aspnet/data-menu/context-menu
Navigation -> Popup Menu