KaxTreeViewContextMenuEventArgs Class |
Namespace: Kettic.AspNet.Controls
The KaxTreeViewContextMenuEventArgs type exposes the following members.
Name | Description | |
---|---|---|
KaxTreeViewContextMenuEventArgs |
Initializes a new instance of the KaxTreeViewContextMenuEventArgs class.
|
Name | Description | |
---|---|---|
MenuItem |
Gets the referenced KaxMenuItem in the
KaxTreeViewContextMenu control
when the event is raised.
| |
Node |
Gets the referenced KaxTreeNode in the
KaxTreeView control when the event is raised.
|
The ContextMenuItemClick event is raised when an item in the KaxTreeViewContextMenu of the KaxTreeView control is clicked.
A click on a KaxTreeViewContextMenu item of the KaxTreeView makes a postback only if an event handler is attached to the ContextMenuItemClick event.
<%@ Page Language="C#" AutoEventWireup="true" %> <%@ Register TagPrefix="Kettic" Namespace="Kettic.AspNet.Controls" Assembly="Kettic.AspNet.Controls" %> <script runat="server"> void KaxTreeView1_ContextMenuItemClick(object sender, KaxTreeViewContextMenuEventArgs e) { lblInfo.Text = string.Format(@"You clicked on Menu Item {0}(""{1}"") of Node {2}(""{3}"")", e.MenuItem.Index, e.MenuItem.Text, e.Node.Index, e.Node.Text); } </script> <html> <body> <form id="form1" runat="server"> <Kettic:KaxScriptManager ID="KaxScriptManager1" runat="server"></Kettic:KaxScriptManager> <br /> <asp:Label ID="lblInfo" style="border:solid 1px black; background-color:InfoBackground;font:normal 12px Courier New;" runat="server">Click on a context menu item to see the information for it.</asp:Label> <br /> <Kettic:KaxTreeView ID="KaxTreeView1" runat="server" OnContextMenuItemClick="KaxTreeView1_ContextMenuItemClick"> <ContextMenus> <Kettic:KaxTreeViewContextMenu ID="ContextMenu1"> <Items> <Kettic:KaxMenuItem Text="Menu1Item1"></Kettic:KaxMenuItem> <Kettic:KaxMenuItem Text="Menu1Item2"></Kettic:KaxMenuItem> </Items> </Kettic:KaxTreeViewContextMenu> <Kettic:KaxTreeViewContextMenu Skin="Outlook" ID="ContextMenu2"> <Items> <Kettic:KaxMenuItem Text="Menu2Item1"></Kettic:KaxMenuItem> <Kettic:KaxMenuItem Text="Menu2Item2"></Kettic:KaxMenuItem> </Items> </Kettic:KaxTreeViewContextMenu> </ContextMenus> <Nodes> <Kettic:KaxTreeNode Text="Node1" ContextMenuID="ContextMenu2"> <Nodes> <Kettic:KaxTreeNode Text="Node11" ContextMenuID="ContextMenu2"></Kettic:KaxTreeNode> <Kettic:KaxTreeNode Text="Node12" ContextMenuID="ContextMenu2"></Kettic:KaxTreeNode> </Nodes> </Kettic:KaxTreeNode> <Kettic:KaxTreeNode Text="Node2" ContextMenuID="ContextMenu2"> <Nodes> <Kettic:KaxTreeNode Text="Node21" ContextMenuID="ContextMenu2"></Kettic:KaxTreeNode> <Kettic:KaxTreeNode Text="Node22" ContextMenuID="ContextMenu2"></Kettic:KaxTreeNode> </Nodes> </Kettic:KaxTreeNode> </Nodes> </Kettic:KaxTreeView> </form> </body> </html>