ComponentOne TreeView for ASP.NET: Client-Side TreeView > Client-Side Events

Client-Side Events

C1TreeView includes several client-side events that allow you to manipulate the node items in the C1TreeView control when an action such as checking the node, clicking the node, collapsing the node, dragging the node, dropping the node, expanding the node, and hovering over the node occurs.

You can access these client-side events from the Properties window. To create a new client-side event using the Properties window, select the drop-down arrow next to a client-side event and select Add new client side handler.

Each of the client-side events requires two parameters: the ID that identifies the sender C1TreeView, in this example, C1TreeView1, and an eventArgs that contains the data of the event.

You can use the sever-side properties, listed in the Client Side Event table, to specify the name of the JavaScript function that will respond to a particular client-side event. For example, to assign a JavaScript function called "NodeClicked" to respond to the clicked item, you would set the OnClientNodeClicked property to "NodeClicked".

The following table lists the events that you can use in your client scripts. These properties are defined on the server side, but the actual events or the name you declare for each JavaScript function are defined on the client side.

Client- Side Events Table

 

Event Server-Side Property Name

Event Name

Description

OnClientNodeCheckChanged

NodeCheckedChanged

If specified, the OnClientNodeChecked client-side event handler is called after a TreeView node is checked by user.(If Check boxes are enabled)

OnClientNodeClicked

NodeClicked

If specified, the OnClientNodeClicked client-side event handler is called after a TreeView node is clicked upon.

OnClientNodeCollapsed

NodeCollapsed

If specified, the OnClientNodeCollapsed client-side event handler is called after a TreeView node is collapsed.

OnClientNodeDragging

NodeDragging

If specified, the OnClientNodeDragging client-side event handler is called if the user moves the mouse while dragging the C1TreeViewNode node.

OnClientNodeDragStarted

NodeDragStarted

If specified, the OnClientNodeDragStarted client-side event handler is called before a drop-and-drop operation starts.

OnClientNodeDropped

NodeDropped

If specified, the OnClientNodeDropped client-side event handler is called after a TreeView node is dropped by user.(after being dragged).

OnClientNodeExpanded

NodeExpanded

If specified, the OnClientNodeExpanded client-side event handler is called after the C1TreeViewNode node has been expanded.

OnClientNodeMouseOut

NodeMouseOut

If specified, the OnClientNodeMouseOut client-side event handler is called if the user moves the mouse pointer out of the C1TreeViewNode node.

OnClientNodeMouseOver

NodeMouseOver

If specified, the OnClientMouseOver client-side event handler is called when the mouse moves over a TreeView node.

OnClientNodeTextChanged

NodeTextChanged

If specified, the OnClientNodeTextChanged client-side event handler is called after a C1TreeViewNode node's text has been edited.

OnClientSelectedNodesChanged

NodeSelection

If specified, the OnClientNodeSelection client-side event handler is called after a TreeViewNode has been selected.

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.