Skip to main content
Version: 4.1

TreeNode

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a node of a TreeView.

public class TreeNode : Component, ICloneable, IHasPropertyStore, IImage

Constructors

Instance member TreeNode()

Initializes a new instance of the TreeNode class.

Instance member TreeNode(text)

Initializes a new instance of the TreeNode class with the specified label text.

NameTypeDescription
textStringThe label Text of the new tree node.

Instance member TreeNode(text, children)

Initializes a new instance of the TreeNode class with the specified label text and child tree nodes.

NameTypeDescription
textStringThe label Text of the new tree node.
childrenTreeNode[]An array of child TreeNode objects.

Instance member TreeNode(text, imageIndex, selectedImageIndex)

Initializes a new instance of the TreeNode class with the specified label text and images to display when the tree node is in a selected and unselected state.

NameTypeDescription
textStringThe label Text of the new tree node.
imageIndexInt32The index value of Image to display when the tree node is unselected.
selectedImageIndexInt32The index value of Image to display when the tree node is selected.

Instance member TreeNode(text, imageIndex, selectedImageIndex, children)

Initializes a new instance of the TreeNode class with the specified label text, child tree nodes, and images to display when the tree node is in a selected and unselected state.

NameTypeDescription
textStringThe label Text of the new tree node.
imageIndexInt32The index value of Image to display when the tree node is unselected.
selectedImageIndexInt32The index value of Image to display when the tree node is selected.
childrenTreeNode[]An array of child TreeNode objects.

Properties

Instance member AllowHtml

Boolean: Returns or sets a value indicating that the tree node can display HTML in the Text property. (Default: False)

Instance member BackColor

Color: Returns or sets the background color of the tree node.

Instance member CheckBox

Nullable<Boolean>: Returns or sets whether a checkbox is displayed next to the tree node. (Default: null)

Instance member Checked

Boolean: Returns or sets whether the tree node is in a checked state. (Default: False)

Instance member CheckState

CheckState: Returns or sets the checked state of the tree node. (Default: Unchecked)

Instance member ContextMenu

ContextMenu: Returns the shortcut menu that is associated with this tree node. (Default: null)

Instance member Enabled

Boolean: Returns or sets whether the tree node is in enabled. (Default: True)

Protected member Events

EventHandlerList: Returns the list of event handlers that are attached to this Component.

Instance member FirstNode

TreeNode: Returns the first child tree node in the tree node collection.

Instance member ForeColor

Color: Returns or sets the foreground color of the tree node.

Instance member FullPath

String: Returns the path from the root tree node to the current tree node.

Instance member HideNodeImage

Nullable<Boolean>: Returns or sets a valid indicating whether the node image next to the tree node is hidden. (Default: null)

Instance member ImageIndex

Int32: Returns or sets the image list index value of the image displayed when the tree node is in the unselected state. (Default: -1)

Throws:

Instance member ImageKey

String: Returns or sets the key for the image associated with this tree node when the node is in an unselected state. (Default: "")

Instance member ImageList

ImageList: Returns the ImageList that contains the images displayed in the TreeNode.

Instance member Index

Int32: Returns the position of the tree node in the tree node collection.

Instance member IsEditing

Boolean: Returns a value indicating whether the tree node is in an editable state.

Instance member IsEnabled

Boolean: Returns or sets whether the tree node is enabled.

Instance member IsExpanded

Boolean: Returns a value indicating whether the tree node is in the expanded state.

Instance member IsParent

Boolean: Returns or sets whether the tree node is a parent node and can be expanded.

Setting this property to true when the node doesn't have any children, will cause the node to expand anyway and request the child nodes from the server.

Instance member IsSelected

Boolean: Returns a value indicating whether the tree node is in the selected state.

Instance member LastNode

TreeNode: Returns the last child tree node.

Instance member LazyLoading

Boolean: Returns or sets whether child nodes are sent to the client the first time this node is expanded. (Default: False)

This option sends less data to the client and speeds up the creation of tree nodes with many child nodes. It can be used in conjunction with the property ShowLoader.

Instance member Level

Int32: Returns the zero-based depth of the tree node in the TreeView control.

Instance member Name

String: Returns or sets the name of the tree node.

Instance member NextNode

TreeNode: Returns the next sibling tree node.

Instance member NextVisibleNode

TreeNode: Returns the next visible tree node.

Instance member NodeCount

Int32: Returns the number of child nodes without forcing the creation of the collection. Since 3.1

Instance member NodeFont

Font: Returns or sets the font that is used to display the text on the tree node label.

Instance member Nodes

TreeNodeCollection: Returns the collection of tree nodes assigned to the current tree node.

Instance member OpenedImageIndex

Int32: Returns or sets the index of the image that is used when the tree node is expanded. (Default: -1)

Throws:

Instance member OpenedImageKey

String: Returns or sets the key of the image that is used when the tree node is expanded. (Default: "")

Instance member Parent

TreeNode: Returns the parent tree node of the current tree node.

Instance member PrevNode

TreeNode: Returns the previous sibling tree node.

Instance member PrevVisibleNode

TreeNode: Returns the previous visible tree node.

Instance member SelectedImageIndex

Int32: Returns or sets the image list index value of the image that is displayed when the tree node is in the selected state. (Default: -1)

Throws:

Instance member SelectedImageKey

String: Returns or sets the key of the image displayed in the tree node when it is in a selected state. (Default: "")

Instance member ShowLoader

Boolean: Returns or sets whether the tree node shows the node-loader image when it is expanding but it doesn't have any child nodes. (Default: False)

Instance member StateImageIndex

Int32: Returns or sets the index of the image that is used to indicate the state of the tree node when the parent TreeView has its CheckBoxes property set to false. (Default: -1)

Throws:

Instance member StateImageKey

String: Returns or sets the key of the image that is used to indicate the state of the tree node when the parent TreeView has its CheckBoxes property set to false. (Default: "")

Instance member Tag

Object: Returns or sets the object that contains data about the tree node. (Default: null)

Instance member Text

String: Returns or sets the text displayed in the label of the tree node. (Default: "")

When AllowHtml is set to true, the text can contain HTML content. If the text contains new lines (CRLF) but doesn't contain HTML elements (at least one "<") all CRLF are automatically substituted with "<br/>".

Instance member ToolTipText

String: Returns or sets the text that appears when the mouse pointer hovers over a tree node. (Default: "")

Instance member TreeView

TreeView: Returns the parent TreeView.

Instance member Visible

Boolean: Returns or sets whether the tree node is visible. (Default: True)

Methods

Instance member BeginEdit()

Initiates the editing of the tree node label.

Throws:

Instance member Clone()

Copies the tree node and the entire subtree rooted at this tree node.

Returns: Object. The Object that represents the cloned TreeNode.

Instance member Collapse()

Collapses the tree node.

Instance member Collapse(ignoreChildren)

Collapses the tree node and optionally collapses its children.

ParameterTypeDescription
ignoreChildrenBooleantrue to leave the child nodes in their current state; false to collapse the child nodes.

Instance member CollapseAll()

Collapses the tree node and all its children.

Protected member Dispose(disposing)

Disposes the tree node.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Instance member EndEdit(cancel)

Cancels the editing of the tree node label.

ParameterTypeDescription
cancelBooleanTrue to discard the edited value.

Instance member EnsureVisible()

Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary.

Instance member Expand()

Expands the tree node.

Instance member ExpandAll()

Expands all the child tree nodes.

Static member FromHandle(tree, handle)

Returns the TreeNode with the specified handle and assigned to the specified TreeView control.

ParameterTypeDescription
treeTreeViewThe TreeView that contains the TreeNode.
handleIntPtrThe handle of the TreeNode.

Returns: TreeNode. The TreeNode assigned to the TreeView with the specified handle.

Instance member GetNodeCount(includeSubTrees)

Returns the number of child tree nodes.

ParameterTypeDescription
includeSubTreesBooleantrue if the resulting count includes all tree nodes indirectly rooted at this tree node; otherwise, false.

Returns: Int32. The number of child tree nodes assigned to the Nodes collection.

Protected member OnAddReferences(items)

Returns a collection of referenced components or collection of components.

ParameterTypeDescription
itemsIList

Protected member OnAfterCheck(e)

Fires the AfterCheck event.

ParameterTypeDescription
eTreeViewEventArgsA TreeViewEventArgs that contains the event data.

Protected member OnAfterCollapse(e)

Fires the AfterCollapse event.

ParameterTypeDescription
eTreeViewEventArgsA TreeViewEventArgs that contains the event data.

Protected member OnAfterExpand(e)

Fires the AfterExpand event.

ParameterTypeDescription
eTreeViewEventArgsA TreeViewEventArgs that contains the event data.

Protected member OnAfterLabelEdit(e)

Fires the AfterLabelEdit event.

ParameterTypeDescription
eNodeLabelEditEventArgsA NodeLabelEditEventArgs that contains the event data.

Protected member OnAfterSelect(e)

Fires the AfterSelect event.

ParameterTypeDescription
eTreeViewEventArgsA TreeViewEventArgs that contains the event data.

Protected member OnBeforeCheck(e)

Fires the BeforeCheck event.

ParameterTypeDescription
eTreeViewCancelEventArgsA TreeViewCancelEventArgs that contains the event data.

Protected member OnBeforeCollapse(e)

Fires the BeforeCollapse event.

ParameterTypeDescription
eTreeViewCancelEventArgsA TreeViewCancelEventArgs that contains the event data.

Protected member OnBeforeExpand(e)

Fires the BeforeExpand event.

ParameterTypeDescription
eTreeViewCancelEventArgsA TreeViewCancelEventArgs that contains the event data.

Protected member OnBeforeLabelEdit(e)

Fires the BeforeLabelEdit event.

ParameterTypeDescription
eNodeLabelEditEventArgsA NodeLabelEditEventArgs that contains the event data.

Protected member OnBeforeSelect(e)

Fires the BeforeSelect event.

ParameterTypeDescription
eTreeViewCancelEventArgsA TreeViewCancelEventArgs that contains the event data.

Protected member OnItemDrag(e)

Deprecated memberDeprecated: This method is deprecated. Use OnNodeDrag instead. Fires the ItemDrag event.

ParameterTypeDescription
eItemDragEventArgsAn ItemDragEventArgs that contains the event data.

Protected member OnNodeDrag(e)

Fires the NodeDrag event.

ParameterTypeDescription
eTreeViewNodeDragEventArgsAn TreeViewNodeDragEventArgs that contains the event data.

Protected member OnNodeMouseClick(e)

Fires the NodeMouseClick event.

ParameterTypeDescription
eTreeNodeMouseClickEventArgsA TreeNodeMouseClickEventArgs that contains the event data.

Protected member OnNodeMouseDoubleClick(e)

Fires the NodeMouseDoubleClick event.

ParameterTypeDescription
eTreeNodeMouseClickEventArgsA TreeNodeMouseClickEventArgs that contains the event data.

Protected member OnNodeMouseHover(e)

Fires the NodeMouseHover event.

ParameterTypeDescription
eTreeNodeMouseHoverEventArgsThe TreeNodeMouseHoverEventArgs that contains the event data.

Protected member OnNodeMouseLeave(e)

Fires the NodeMouseLeave event.

ParameterTypeDescription
eTreeNodeMouseHoverEventArgsThe TreeNodeMouseHoverEventArgs that contains the event data.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Instance member Remove()

Removes the current tree node from the tree view control.

Instance member Toggle()

Toggles the tree node to either the expanded or collapsed state.

Instance member Update()

Updates the component on the client. Overridden to repaint the tree view in design mode.

Events

Instance member AfterCheck

TreeViewEventHandler Occurs after the tree node check box is checked.

Instance member AfterCollapse

TreeViewEventHandler Occurs after the tree node is collapsed.

Instance member AfterExpand

TreeViewEventHandler Occurs after the tree node is expanded.

Instance member AfterLabelEdit

NodeLabelEditEventHandler Occurs after the tree node label text is edited.

Instance member AfterSelect

TreeViewEventHandler Occurs after the tree node is selected.

Instance member BeforeCheck

TreeViewCancelEventHandler Occurs before the tree node check box is checked.

Instance member BeforeCollapse

TreeViewCancelEventHandler Occurs before the tree node is collapsed.

Instance member BeforeExpand

TreeViewCancelEventHandler Occurs before the tree node is expanded.

Instance member BeforeLabelEdit

NodeLabelEditEventHandler Occurs before the tree node label text is edited.

Instance member BeforeSelect

TreeViewCancelEventHandler Occurs before the tree node is selected.

Instance member ItemDrag

Deprecated memberDeprecated: This event is deprecated. Use NodeDrag instead. ItemDragEventHandler Fired when the user begins dragging a TreeNode.

Instance member NodeDrag

TreeViewNodeDragEventHandler Fired when the user begins dragging a TreeNode.

Instance member NodeMouseClick

TreeNodeMouseClickEventHandler Fired when the user clicks a TreeNode with the mouse.

Instance member NodeMouseDoubleClick

TreeNodeMouseClickEventHandler Fired when the user double-clicks a TreeNode with the mouse.

Instance member NodeMouseHover

TreeNodeMouseHoverEventHandler Fired when the mouse hovers over a TreeNode.

Instance member NodeMouseLeave

TreeNodeMouseHoverEventHandler Fired when the mouse leaves the TreeNode.

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IImageProvides access to common image properties across the controls that implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejSerializableAllows an object to serialize itself.