Skip to main content
Version: 3.5

TreeView

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Displays a hierarchical collection of labeled items, each represented by a TreeNode.

public class TreeView : Control

Constructors

Instance memberTreeView()

Initializes a new instance of the TreeView class.

Properties

Instance memberBorderStyle

BorderStyle: Gets or sets the border style of the tree view control. (Default: Solid)

Instance memberCheckBoxes

Boolean: Returns or sets whether check boxes are displayed next to the tree nodes in the tree view control. Tree nodes may override this property setting the CheckBox property. (Default: False)

Instance memberHideNodeImages

Boolean: Returns or sets whether all the node images are hidden. Tree nodes may override this property setting the HideNodeImage property. (Default: False)

Instance memberImageIndex

Int32: Returns or sets the image-list index value of the default image that is displayed by the tree nodes. (Default: -1)

Throws:

Instance memberImageKey

String: Returns or sets the key of the default image for each node in the TreeView control when it is in an unselected state. (Default: "")

Instance memberImageList

ImageList: Returns or sets the ImageList that contains the Image objects that are used by the tree nodes. (Default: null)

Instance memberIndent

Int32: Returns or sets the distance in pixels to indent each child tree node level. (Default: -1)

Throws:

Instance memberItemHeight

Int32: Gets or sets the height of each tree node in the tree view control. When the value is -1, uses the value set in the theme. (Default: -1)

Throws:

Instance memberLabelEdit

Boolean: Returns or sets whether the label text of the tree nodes can be edited. (Default: False)

Instance memberNodes

TreeNodeCollection: Returns the collection of tree nodes that are assigned to the tree view control.

Instance memberOpenedImageIndex

Int32: Returns or sets the image list index value of the image that is displayed when a TreeNode is expanded. (Default: -1)

Throws:

Instance memberOpenedImageKey

String: Returns or sets the key of the default image shown when a TreeNode is expanded. (Default: "")

Instance memberPathSeparator

String: Returns or sets the delimiter string that the tree node path uses. (Default: "\")

Instance memberPrefetchItems

Int32: Returns or sets the number of items to prefetch outside of the visible area when VirtualScroll is set to true. The default is 0 (disabled). (Default: 0)

Instance memberRightClickSelection

Boolean: Returns or sets whether the TreeNode under the pointer gets selected on a right click. (Default: False)

When the right click lands outside of a selected area the selection is not changed regardless of the value of RightClickSelection.

Instance memberScrollable

Boolean: Returns or sets whether the tree view control displays scroll bars when they are needed. (Default: True)

Instance memberSelectedImageIndex

Int32: Returns or sets the image list index value of the image that is displayed when a TreeNode is selected. (Default: -1)

Throws:

Instance memberSelectedImageKey

String: Returns or sets the key of the default image shown when a TreeNode is selected. (Default: "")

Instance memberSelectedNode

TreeNode: Returns or sets the tree node that is currently selected in the tree view control.

Instance memberSelectedNodes

TreeNode[]: Returns or sets the tree nodes that are currently selected in the tree view control. Use this property when the SelectionMode is MultiSimple or MultiExtended.

Instance memberSelectionMode

SelectionMode: Returns or sets the method in which items are selected in the TreeView. (Default: One)

Instance memberShowNodeToolTips

Boolean: Returns or sets a value indicating ToolTips are shown when the mouse pointer hovers over a TreeNode. (Default: False)

Instance memberShowPlusMinus

Boolean: Returns or sets whether plus-sign (+) and minus-sign (-) buttons are displayed next to tree nodes that contain child tree nodes. (Default: True)

Instance memberShowRootLines

Boolean: Returns or sets whether the expand/collapse icon is displayed for the root nodes (the firs level nodes). (Default: True)

The name of this property is kept as-is for compatibility reasons. When set to true (default) it doesn't show any line next to the root nodes or any other node. It shows or hide the expand/collapse icon next to the root nodes.

Instance memberSorted

Boolean: Returns or sets whether the tree nodes in the tree view are sorted. (Default: False)

Instance memberStateImageList

ImageList: Returns or sets the image list that is used to indicate the state of the TreeView and its nodes. (Default: null)

Instance memberTools

ComponentToolCollection: Returns the instance of ComponentToolCollection associated with this control.

Instance memberTopNode

TreeNode: Returns or sets the first fully-visible tree node in the tree view control.

Instance memberTreeViewNodeSorter

IComparer<TreeNode>: Returns or sets the implementation of IComparer to perform a custom sort of the TreeView nodes.

Instance memberVirtualScroll

Boolean: Enables or disables virtual scrolling for the TreeView. When virtual scrolling is enabled, only the visible nodes are rendered in the browser allowing the TreeView to host virtually unlimited nodes without any performance loss. (Default: False)

When VirtualScroll is set to true, all the nodes must be of the same height, limiting the more flexible HTML rendering in the nodes available when VirtualScroll is off (default). Setting the property PrefetchItems to a value greater than 0 allows the virtual view to prefetch the specified number of items outside of the visible area to enable smoother scrolling.

Methods

Instance memberBeginUpdate()

This method has no effect on this control.

Instance memberClearSelected()

Unselects all nodes in the TreeView.

Instance memberCollapseAll()

Collapses all the tree nodes.

Instance memberEndUpdate()

This method has no effect on this control.

Instance memberExpandAll()

Expands all the tree nodes.

Instance memberGetNodeCount(includeSubTrees)

Retrieves the number of tree nodes, optionally including those in all subtrees, assigned to the tree view control.

ParameterTypeDescription
includeSubTreesBooleantrue to count the TreeNode items that the subtrees contain; otherwise, false.

Returns: Int32. The number of tree nodes, optionally including those in all subtrees, assigned to the tree view control.

Instance memberGetSelected(node)

Returns a value indicating whether the specified TreeNode is selected.

ParameterTypeDescription
nodeTreeNodeThe TreeNode to check.

Returns: Boolean. true if the specified TreeNode is currently selected in the TreeView; otherwise, false.

Throws:

Instance memberSetSelected(node, selected)

Selects or clears the selection for the specified TreeNode in a TreeView.

ParameterTypeDescription
nodeTreeNodeThe TreeNode to select.
selectedBooleanTrue to select the specified TreeNode, otherwise false to deselect it.

Throws:

Instance memberSort()

Sorts the items in TreeView control.

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

Instance memberNodeDrag

TreeViewNodeDragEventHandler Fired when the user begins dragging a node.

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.

Instance memberToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Implements

NameDescription
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.