TreeNode
Wisej.Web.TreeNode
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.1.0.0)
Represents a node of a TreeView.
Constructors
TreeNode()
Initializes a new instance of the TreeNode class.
TreeNode(text)
Initializes a new instance of the TreeNode class with the specified label text.
TreeNode(text, children)
Initializes a new instance of the TreeNode class with the specified label text and child tree nodes.
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.
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.
Properties
AllowHtml
Boolean: Returns or sets a value indicating that the tree node can display HTML in the Text property. (Default: False
)
BackColor
Color: Returns or sets the background color of the tree node.
CheckBox
Nullable<Boolean>: Returns or sets whether a checkbox is displayed next to the tree node. (Default: null
)
Checked
Boolean: Returns or sets whether the tree node is in a checked state. (Default: False
)
CheckState
CheckState: Returns or sets the checked state of the tree node. (Default: Unchecked
)
ContextMenu
ContextMenu: Returns the shortcut menu that is associated with this tree node. (Default: null
)
Enabled
Boolean: Returns or sets whether the tree node is in enabled. (Default: True
)
FirstNode
TreeNode: Returns the first child tree node in the tree node collection.
ForeColor
Color: Returns or sets the foreground color of the tree node.
FullPath
String: Returns the path from the root tree node to the current tree node.
HideNodeImage
Nullable<Boolean>: Returns or sets a valid indicating whether the node image next to the tree node is hidden. (Default: null
)
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:
ArgumentOutOfRangeException The specified index is less than -1.
ImageKey
String: Returns or sets the key for the image associated with this tree node when the node is in an unselected state. (Default: ""
)
ImageList
ImageList: Returns the ImageList that contains the images displayed in the TreeNode.
Index
Int32: Returns the position of the tree node in the tree node collection.
IsEditing
Boolean: Returns a value indicating whether the tree node is in an editable state.
IsEnabled
Boolean: Returns or sets whether the tree node is enabled.
IsExpanded
Boolean: Returns a value indicating whether the tree node is in the expanded state.
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.
IsSelected
Boolean: Returns a value indicating whether the tree node is in the selected state.
LastNode
TreeNode: Returns the last child tree node.
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.
Level
Int32: Returns the zero-based depth of the tree node in the TreeView control.
Name
String: Returns or sets the name of the tree node.
NextNode
TreeNode: Returns the next sibling tree node.
NextVisibleNode
TreeNode: Returns the next visible tree node.
NodeCount
Int32: Returns the number of child nodes without forcing the creation of the collection. [Since 3.1]
NodeFont
Font: Returns or sets the font that is used to display the text on the tree node label.
Nodes
TreeNodeCollection: Returns the collection of tree nodes assigned to the current tree node.
OpenedImageIndex
Int32: Returns or sets the index of the image that is used when the tree node is expanded. (Default: -1
)
Throws:
ArgumentOutOfRangeException The specified index is less than -1.
OpenedImageKey
String: Returns or sets the key of the image that is used when the tree node is expanded. (Default: ""
)
Parent
TreeNode: Returns the parent tree node of the current tree node.
PrevNode
TreeNode: Returns the previous sibling tree node.
PrevVisibleNode
TreeNode: Returns the previous visible tree node.
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:
ArgumentOutOfRangeException The specified index is less than -1.
SelectedImageKey
String: Returns or sets the key of the image displayed in the tree node when it is in a selected state. (Default: ""
)
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
)
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:
ArgumentOutOfRangeException The specified index is less than -1.
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: ""
)
Tag
Object: Returns or sets the object that contains data about the tree node. (Default: null
)
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/>".
ToolTipText
String: Returns or sets the text that appears when the mouse pointer hovers over a tree node. (Default: ""
)
TreeView
TreeView: Returns the parent TreeView.
Visible
Boolean: Returns or sets whether the tree node is visible. (Default: True
)
Methods
BeginEdit()
Initiates the editing of the tree node label.
Throws:
InvalidOperationException LabelEdit is set to false.
Clone()
Copies the tree node and the entire subtree rooted at this tree node.
Returns: Object. The Object that represents the cloned TreeNode.
Collapse()
Collapses the tree node.
Collapse(ignoreChildren)
Collapses the tree node and optionally collapses its children.
ignoreChildren
true to leave the child nodes in their current state; false to collapse the child nodes.
CollapseAll()
Collapses the tree node and all its children.
EndEdit(cancel)
Cancels the editing of the tree node label.
EnsureVisible()
Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary.
Expand()
Expands the tree node.
ExpandAll()
Expands all the child tree nodes.
FromHandle(tree, handle)
Returns the TreeNode with the specified handle and assigned to the specified TreeView control.
Returns: TreeNode. The TreeNode assigned to the TreeView with the specified handle.
GetNodeCount(includeSubTrees)
Returns the number of child tree nodes.
includeSubTrees
true 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.
Remove()
Removes the current tree node from the tree view control.
Toggle()
Toggles the tree node to either the expanded or collapsed state.
Update()
Updates the component on the client. Overridden to repaint the tree view in design mode.
Events
AfterCheck
TreeViewEventHandler Occurs after the tree node check box is checked.
AfterCollapse
TreeViewEventHandler Occurs after the tree node is collapsed.
AfterExpand
TreeViewEventHandler Occurs after the tree node is expanded.
AfterLabelEdit
NodeLabelEditEventHandler Occurs after the tree node label text is edited.
AfterSelect
TreeViewEventHandler Occurs after the tree node is selected.
BeforeCheck
TreeViewCancelEventHandler Occurs before the tree node check box is checked.
BeforeCollapse
TreeViewCancelEventHandler Occurs before the tree node is collapsed.
BeforeExpand
TreeViewCancelEventHandler Occurs before the tree node is expanded.
BeforeLabelEdit
NodeLabelEditEventHandler Occurs before the tree node label text is edited.
BeforeSelect
TreeViewCancelEventHandler Occurs before the tree node is selected.
ItemDrag
Deprecated: This event is deprecated. Use NodeDrag instead. ItemDragEventHandler Fired when the user begins dragging a TreeNode.
NodeDrag
TreeViewNodeDragEventHandler Fired when the user begins dragging a TreeNode.
NodeMouseClick
TreeNodeMouseClickEventHandler Fired when the user clicks a TreeNode with the mouse.
NodeMouseDoubleClick
TreeNodeMouseClickEventHandler Fired when the user double-clicks a TreeNode with the mouse.
NodeMouseHover
TreeNodeMouseHoverEventHandler Fired when the mouse hovers over a TreeNode.
NodeMouseLeave
TreeNodeMouseHoverEventHandler Fired when the mouse leaves the TreeNode.
Implements
Provides access to common image properties across the controls that implement this interface.
All wisej components implement this interface.
Allows an object to serialize itself.
Last updated