Skip to main content
Version: 3.5

TreeNode

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents a node of a TreeView.

public class TreeNode : Component, ICloneable, IHasPropertyStore, IImage

Constructors

Instance memberTreeNode()

Initializes a new instance of the TreeNode class.

Instance memberTreeNode(text)

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

NameTypeDescription
textStringThe label Text of the new tree node.

Instance memberTreeNode(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 memberTreeNode(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 memberTreeNode(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 memberAllowHtml

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

Instance memberBackColor

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

Instance memberCheckBox

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

Instance memberChecked

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

Instance memberCheckState

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

Instance memberContextMenu

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

Instance memberEnabled

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

Instance memberFirstNode

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

Instance memberForeColor

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

Instance memberFullPath

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

Instance memberHideNodeImage

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

Instance memberImageIndex

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 memberImageKey

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

Instance memberImageList

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

Instance memberIndex

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

Instance memberIsEditing

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

Instance memberIsEnabled

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

Instance memberIsExpanded

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

Instance memberIsParent

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 memberIsSelected

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

Instance memberLastNode

TreeNode: Returns the last child tree node.

Instance memberLazyLoading

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 memberLevel

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

Instance memberName

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

Instance memberNextNode

TreeNode: Returns the next sibling tree node.

Instance memberNextVisibleNode

TreeNode: Returns the next visible tree node.

Instance memberNodeCount

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

Instance memberNodeFont

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

Instance memberNodes

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

Instance memberOpenedImageIndex

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

Throws:

Instance memberOpenedImageKey

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

Instance memberParent

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

Instance memberPrevNode

TreeNode: Returns the previous sibling tree node.

Instance memberPrevVisibleNode

TreeNode: Returns the previous visible tree node.

Instance memberSelectedImageIndex

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 memberSelectedImageKey

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

Instance memberShowLoader

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 memberStateImageIndex

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 memberStateImageKey

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 memberTag

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

Instance memberText

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 memberToolTipText

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

Instance memberTreeView

TreeView: Returns the parent TreeView.

Instance memberVisible

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

Methods

Instance memberBeginEdit()

Initiates the editing of the tree node label.

Throws:

Instance memberClone()

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

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

Instance memberCollapse()

Collapses the tree node.

Instance memberCollapse(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 memberCollapseAll()

Collapses the tree node and all its children.

Instance memberEndEdit(cancel)

Cancels the editing of the tree node label.

ParameterTypeDescription
cancelBooleanTrue to discard the edited value.

Instance memberEnsureVisible()

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

Instance memberExpand()

Expands the tree node.

Instance memberExpandAll()

Expands all the child tree nodes.

Static memberFromHandle(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 memberGetNodeCount(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.

Instance memberRemove()

Removes the current tree node from the tree view control.

Instance memberToggle()

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

Instance memberUpdate()

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

Events

Instance memberAfterCheck

TreeViewEventHandler Occurs after the tree node check box is checked.

Instance memberAfterCollapse

TreeViewEventHandler Occurs after the tree node is collapsed.

Instance memberAfterExpand

TreeViewEventHandler Occurs after the tree node is expanded.

Instance memberAfterLabelEdit

NodeLabelEditEventHandler Occurs after the tree node label text is edited.

Instance memberAfterSelect

TreeViewEventHandler Occurs after the tree node is selected.

Instance memberBeforeCheck

TreeViewCancelEventHandler Occurs before the tree node check box is checked.

Instance memberBeforeCollapse

TreeViewCancelEventHandler Occurs before the tree node is collapsed.

Instance memberBeforeExpand

TreeViewCancelEventHandler Occurs before the tree node is expanded.

Instance memberBeforeLabelEdit

NodeLabelEditEventHandler Occurs before the tree node label text is edited.

Instance memberBeforeSelect

TreeViewCancelEventHandler Occurs before the tree node is selected.

Instance memberItemDrag

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

Instance memberNodeDrag

TreeViewNodeDragEventHandler Fired when the user begins dragging a TreeNode.

Instance memberNodeMouseClick

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

Instance memberNodeMouseDoubleClick

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

Instance memberNodeMouseHover

TreeNodeMouseHoverEventHandler Fired when the mouse hovers over a TreeNode.

Instance memberNodeMouseLeave

TreeNodeMouseHoverEventHandler Fired when the mouse leaves the TreeNode.

Implements

NameDescription
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.