TreeView

Wisej.Web.TreeView

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.0.0.0)

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

public class TreeView : Control

Constructors

TreeView()

Initializes a new instance of the TreeView class.

Properties

BorderStyle

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

CheckBoxes

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)

HideNodeImages

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

ImageIndex

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

Throws:

ImageKey

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: "")

ImageList

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

Indent

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

Throws:

ItemHeight

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:

LabelEdit

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

Nodes

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

OpenedImageIndex

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

Throws:

OpenedImageKey

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

PathSeparator

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

PrefetchItems

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)

RightClickSelection

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.

Scrollable

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

SelectedImageIndex

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

Throws:

SelectedImageKey

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

SelectedNode

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

SelectedNodes

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.

SelectionMode

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

ShowNodeToolTips

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

ShowPlusMinus

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

ShowRootLines

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.

Sorted

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

StateImageList

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

Tools

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

TopNode

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

TreeViewNodeSorter

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

VirtualScroll

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

BeginUpdate()

This method has no effect on this control.

ClearSelected()

Unselects all nodes in the TreeView.

CollapseAll()

Collapses all the tree nodes.

Dispose(disposing)

Disposes the control.

Parameter
Type
Description

disposing

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

EndUpdate()

This method has no effect on this control.

ExpandAll()

Expands all the tree nodes.

GetNodeCount(includeSubTrees)

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

Parameter
Type
Description

includeSubTrees

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

GetSelected(node)

Returns a value indicating whether the specified TreeNode is selected.

Parameter
Type
Description

node

The TreeNode to check.

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

Throws:

OnAddReferences(items)

Returns a collection of referenced components or collection of components.

Parameter
Type
Description

items

OnAfterCheck(e)

Fires the AfterCheck event.

Parameter
Type
Description

e

A TreeViewEventArgs that contains the event data.

OnAfterCollapse(e)

Fires the AfterCollapse event.

Parameter
Type
Description

e

A TreeViewEventArgs that contains the event data.

OnAfterExpand(e)

Fires the AfterExpand event.

Parameter
Type
Description

e

A TreeViewEventArgs that contains the event data.

OnAfterLabelEdit(e)

Fires the AfterLabelEdit event.

Parameter
Type
Description

e

A NodeLabelEditEventArgs that contains the event data.

OnAfterSelect(e)

Fires the AfterSelect event.

Parameter
Type
Description

e

A TreeViewEventArgs that contains the event data.

OnBeforeCheck(e)

Fires the BeforeCheck event.

Parameter
Type
Description

e

A TreeViewCancelEventArgs that contains the event data.

OnBeforeCollapse(e)

Fires the BeforeCollapse event.

Parameter
Type
Description

e

A TreeViewCancelEventArgs that contains the event data.

OnBeforeExpand(e)

Fires the BeforeExpand event.

Parameter
Type
Description

e

A TreeViewCancelEventArgs that contains the event data.

OnBeforeLabelEdit(e)

Fires the BeforeLabelEdit event.

Parameter
Type
Description

e

A NodeLabelEditEventArgs that contains the event data.

OnBeforeSelect(e)

Fires the BeforeSelect event.

Parameter
Type
Description

e

A TreeViewCancelEventArgs that contains the event data.

OnCreateControl()

Creates and register this control and all its children.

OnItemDrag(e)

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

Parameter
Type
Description

e

An ItemDragEventArgs that contains the event data.

OnNodeDrag(e)

Fires the NodeDrag event.

Parameter
Type
Description

e

An TreeViewNodeDragEventArgs that contains the event data.

OnNodeMouseClick(e)

Fires the NodeMouseClick event.

Parameter
Type
Description

OnNodeMouseDoubleClick(e)

Fires the NodeMouseDoubleClick event.

Parameter
Type
Description

OnNodeMouseHover(e)

Fires the NodeMouseHover event.

Parameter
Type
Description

OnNodeMouseLeave(e)

Fires the NodeMouseLeave event.

Parameter
Type
Description

OnToolClick(e)

Fires the ToolClick event.

Parameter
Type
Description

e

A ToolClickEventArgs that contains the event data.

OnWebEvent(e)

Processes the event from the client.

Parameter
Type
Description

e

Event arguments.

OnWebRender(config)

Renders the client component.

Parameter
Type
Description

config

Dynamic configuration object.

OnWebUpdate(state)

Updates the client component using the state information.

Parameter
Type
Description

state

Dynamic state object.

SetSelected(node, selected)

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

Parameter
Type
Description

node

The TreeNode to select.

selected

True to select the specified TreeNode, otherwise false to deselect it.

Throws:

Sort()

Sorts the items in TreeView control.

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

NodeDrag

TreeViewNodeDragEventHandler Fired when the user begins dragging a node.

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.

ToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Implements

Name
Description

Provides access to the UserData and Tag properties associated to the component implementing this interface.

Bindable components implement this interface.

Controls that support drag & drop operations implement this interface.

All wisej components implement this interface.

All wisej controls derived from the Control class must implement this interface.

Allows an object to serialize itself.

Last updated

Was this helpful?