ClassRadTreeView
Represents a hierarchical tree view control that displays a collection of labeled items in a tree structure. Each item is represented by a RadTreeNode and can contain child nodes, images, and custom content. The control supports data binding, drag-and-drop operations, context menus, and various selection modes.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Data Controls")]
[ComplexBindingProperties("DataSource", "DataMember")]
[LookupBindingProperties("DataSource", "DisplayMember", "ValueMember", "SelectedNode")]
[Docking(DockingBehavior.Ask)]
public class RadTreeView : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IFilterable, ISupportRootUIAutomation
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadTreeView
Derived Classes:
Implements:
Inherited Members
Constructors
RadTreeView()
Initializes a new instance of the RadTreeView class with default settings. Sets up event handlers and prepares the tree view for operation.
Declaration
public RadTreeView()
Properties
ActiveEditor
Gets the active editor currently being used for editing a tree node. Returns null if no node is currently being edited.
AllowAdd
Gets or sets a value indicating whether adding new tree nodes is allowed. When enabled, users can create new nodes through the user interface.
AllowArbitraryItemHeight
Gets or sets a value indicating whether tree nodes can have different heights. When enabled, individual nodes can be sized independently based on their content.
Declaration
[Browsable(true)]
public virtual bool AllowArbitraryItemHeight { get; set; }
Property Value
AllowDefaultContextMenu
Gets or sets a value indicating whether the default context menu is enabled for the tree view. When enabled, a built-in context menu with common operations is available.
AllowDragDrop
Gets or sets a value indicating whether drag and drop operations with tree view nodes are enabled. When enabled, users can drag nodes to reorder or move them within the tree structure.
AllowEdit
Gets or sets a value indicating whether node text editing is allowed. When enabled, users can edit node text by clicking on selected nodes or pressing F2.
AllowPlusMinusAnimation
Gets or sets a value indicating whether animation of expand/collapse buttons is enabled. When enabled, the plus/minus buttons will be animated during expand/collapse operations.
AllowRemove
Gets or sets a value indicating whether removing tree nodes is allowed. When enabled, users can delete nodes through the user interface.
AutoCheckChildNodes
Gets or sets a value indicating whether child nodes should be automatically checked when the tree view is in tri-state mode. When enabled, checking a parent node will automatically check all its child nodes.
Declaration
public virtual bool AutoCheckChildNodes { get; set; }
Property Value
AutoScroll
Gets or sets a value indicating whether the control automatically provides scrollbars when content exceeds the visible area. This property controls the automatic display of scrollbars in the tree view when needed.
Declaration
[Browsable(false)]
public override bool AutoScroll { get; set; }
Property Value
Overrides
CheckBoxes
Gets or sets a value indicating whether checkboxes are displayed beside the tree nodes. When enabled, users can check/uncheck nodes independently of selection.
CheckedMember
Gets or sets the property in the data source that determines the checked state of tree node checkboxes. This property is used when CheckBoxes is enabled and the tree view is data-bound.
Declaration
public virtual string CheckedMember { get; set; }
Property Value
CheckedNodes
Gets the collection of tree nodes that are currently checked. This collection is populated when CheckBoxes is enabled.
Declaration
[Browsable(false)]
public virtual CheckedTreeNodeCollection CheckedNodes { get; }
Property Value
ChildMember
Gets or sets the property in the data source that contains child node data for hierarchical binding. This property is used for self-referencing data sources to establish parent-child relationships.
ContextMenuStrip
Gets or sets the ContextMenuStrip associated with this control.
Declaration
[Browsable(false)]
public override ContextMenuStrip ContextMenuStrip { get; set; }
Property Value
Overrides
DataMember
Gets or sets the name of the data member in the data source for which the RadTreeView is displaying data. This property specifies which table or list within the data source to bind to.
Declaration
[Browsable(true)]
public virtual string DataMember { get; set; }
Property Value
DataSource
Gets or sets the data source that provides data for the RadTreeView. This can be any object that implements IList or IListSource.
Declaration
public virtual object DataSource { get; set; }
Property Value
Implements
DefaultSize
Gets the default size for the tree view control.
Declaration
protected override Size DefaultSize { get; }
Property Value
Overrides
DisplayMember
Gets or sets the property to display for each tree node when the tree view is data-bound. This property specifies which field from the data source should be used for node text.
Declaration
public virtual string DisplayMember { get; set; }
Property Value
DropHintColor
Gets or sets the color of the drop hint displayed during drag and drop operations. The drop hint provides visual feedback to assist users in understanding where items can be dropped.
EnableDeferredScrolling
Gets or sets a value indicating whether deferred scrolling is enabled for improved performance. When enabled, scrolling updates are deferred until the scrolling operation completes.
Declaration
[Browsable(false)]
public bool EnableDeferredScrolling { get; set; }
Property Value
EnableKineticScrolling
Gets or sets a value indicating whether kinetic scrolling is enabled for touch-based interactions. When enabled, scrolling continues with momentum after the user stops touching, providing a natural scrolling experience.
Declaration
[Browsable(true)]
public bool EnableKineticScrolling { get; set; }
Property Value
EnableUIAutomation
Gets or sets a value indicating whether the UI Automation functionality is enabled or disabled for this control.
Declaration
public override bool EnableUIAutomation { get; set; }
Property Value
Overrides
Implements
ExpandAnimation
Gets or sets the type of animation used when expanding or collapsing tree nodes. This property controls the visual effect applied during node expand/collapse operations.
Declaration
public ExpandAnimation ExpandAnimation { get; set; }
Property Value
ExpandMode
Gets or sets the expand mode that controls how nodes can be expanded. This property determines whether single or multiple nodes can be expanded simultaneously.
Declaration
[Browsable(false)]
public ExpandMode ExpandMode { get; set; }
Property Value
Filter
Gets or sets the filter applied to tree nodes. This property allows filtering of tree nodes based on custom criteria.
Declaration
[Browsable(false)]
public virtual object Filter { get; set; }
Property Value
FilterDescriptors
Gets the collection of filter descriptors applied to the tree view. These descriptors define the filtering criteria for tree nodes.
Declaration
[Browsable(false)]
public virtual FilterDescriptorCollection FilterDescriptors { get; }
Property Value
Implements
FindStringComparer
Gets or sets the string comparer used for keyboard navigation functionality. This comparer determines how text matching is performed during keyboard search.
Declaration
[Browsable(false)]
public virtual IFindStringComparer FindStringComparer { get; set; }
Property Value
FullRowSelect
Gets or sets a value indicating whether the selection highlight spans the full width of the tree view. When enabled, the selected node highlight extends across the entire width of the control.
HScrollBar
Gets the horizontal scroll bar element of the tree view control. This scroll bar appears when the tree content extends beyond the control's width.
Declaration
[Browsable(false)]
public RadScrollBarElement HScrollBar { get; }
Property Value
HideSelection
Gets or sets a value indicating whether the selection highlight is hidden when the control loses focus. When enabled, selected nodes remain visually highlighted even when the tree view is not focused.
HotTracking
Gets or sets a value indicating whether hot tracking is enabled for tree nodes. When enabled, nodes are highlighted when the mouse pointer hovers over them.
ImageIndex
Gets or sets the default image index for tree nodes in the associated ImageList. This value is used for nodes that don't have a specific image index assigned.
Declaration
[RelatedImageList("ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.NoneExcludedImageIndexConverter, Telerik.WinControls.UI.Design, Version=2026.1.217.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public virtual int ImageIndex { get; set; }
Property Value
ImageKey
Gets or sets the default image key for tree nodes in the associated ImageList. This value is used for nodes that don't have a specific image key assigned.
Declaration
[RelatedImageList("ImageList")]
[TypeConverter(typeof(ImageKeyConverter))]
public virtual string ImageKey { get; set; }
Property Value
IsEditing
Gets a value indicating whether there is an active editor currently open for editing a tree node. Returns true if a node is currently being edited, false otherwise.
ItemHeight
Gets or sets the height of tree view items in pixels. This property controls the vertical spacing of tree nodes.
Declaration
[Browsable(false)]
public virtual int ItemHeight { get; set; }
Property Value
KeyboardSearchEnabled
Gets or sets a value indicating whether keyboard search navigation is enabled. When enabled, users can navigate to nodes by typing the first characters of node text.
Declaration
[Browsable(true)]
public virtual bool KeyboardSearchEnabled { get; set; }
Property Value
KeyboardSearchResetInterval
Gets or sets the time interval in milliseconds before keyboard search is reset. This determines how long to wait between keystrokes before starting a new search.
Declaration
[Browsable(true)]
public virtual int KeyboardSearchResetInterval { get; set; }
Property Value
LazyMode
Gets or sets a value indicating whether the tree view loads child node collections in the NodesNeeded event only when parent nodes are expanded. This lazy loading approach improves performance by deferring node loading until actually needed.
Declaration
[Browsable(false)]
public bool LazyMode { get; set; }
Property Value
LineColor
Gets or sets the color of the lines connecting parent and child nodes in the tree view. This property is only effective when ShowLines is enabled.
LineStyle
Gets or sets the style of lines connecting parent and child nodes in the tree view. This property controls the visual appearance of the connecting lines when ShowLines is enabled.
Declaration
public virtual TreeLineStyle LineStyle { get; set; }
Property Value
LineWidth
Gets or sets the width in pixels of the lines connecting parent and child nodes. This property controls the thickness of the connecting lines when ShowLines is enabled.
MultiSelect
Gets or sets a value indicating whether the user is allowed to select multiple tree nodes at one time. When enabled, users can hold Ctrl or Shift keys to select multiple nodes.
Nodes
Gets the collection of tree nodes that are assigned to the tree view control. This collection contains all root-level nodes and provides access to the entire tree structure.
Declaration
[Browsable(true)]
public virtual RadTreeNodeCollection Nodes { get; }
Property Value
ParentMember
Gets or sets the property in the data source that identifies the parent node for hierarchical binding. This property is used for self-referencing data sources to establish parent-child relationships.
Declaration
public virtual string ParentMember { get; set; }
Property Value
PathSeparator
Gets or sets the character used as a separator in the node path. This separator is used when constructing or parsing hierarchical node paths.
Declaration
public virtual string PathSeparator { get; set; }
Property Value
PlusMinusAnimationStep
Gets or sets the opacity animation step for expand/collapse animation. This controls the granularity of the opacity change during node expand/collapse animations.
Declaration
[Browsable(false)]
public double PlusMinusAnimationStep { get; set; }
Property Value
RadContextMenu
Gets or sets the RadContextMenu associated with this tree view control. This context menu is displayed when users right-click on the tree view.
Declaration
public virtual RadContextMenu RadContextMenu { get; set; }
Property Value
RelationBindings
Gets the collection of relation bindings that define how hierarchical data relationships are established. This collection contains data binding settings for related data in master-detail scenarios.
Declaration
[Browsable(true)]
public RelationBindingCollection RelationBindings { get; }
Property Value
SelectedNode
Gets or sets the currently selected tree node. Returns null if no node is selected.
Declaration
[Browsable(false)]
public virtual RadTreeNode SelectedNode { get; set; }
Property Value
SelectedNodes
Gets the collection of currently selected tree nodes. This collection contains all selected nodes when MultiSelect is enabled.
Declaration
[Browsable(false)]
public virtual SelectedTreeNodeCollection SelectedNodes { get; }
Property Value
ShowDragHint
Gets or sets a value indicating whether drag hints are displayed when dragging items. When enabled, visual feedback shows the item being dragged during drag and drop operations.
ShowDropHint
Gets or sets a value indicating whether drop hints are displayed during drag and drop operations. When enabled, visual indicators show where items can be dropped in the tree hierarchy.
ShowExpandCollapse
Gets or sets a value indicating whether expand/collapse buttons are shown next to nodes with children. When enabled, plus/minus buttons allow users to expand or collapse parent nodes.
ShowLines
Gets or sets a value indicating whether lines connecting parent and child nodes are displayed. When enabled, visual lines show the hierarchical relationship between nodes.
ShowNodeToolTips
Gets or sets a value indicating whether tooltips are displayed for tree nodes. When enabled, node tooltips will be shown when hovering over nodes with the mouse.
ShowRootLines
Gets or sets a value indicating whether lines are displayed between root-level nodes. When enabled, connecting lines are shown between top-level nodes in the tree view.
SortDescriptors
Gets the collection of sort descriptors applied to the tree view. These descriptors define the sorting criteria for tree nodes.
Declaration
[Browsable(false)]
public SortDescriptorCollection SortDescriptors { get; }
Property Value
SortOrder
Gets or sets the sort order of tree nodes. This property controls how nodes are sorted within each level of the tree hierarchy.
Declaration
[Browsable(true)]
public SortOrder SortOrder { get; set; }
Property Value
SpacingBetweenNodes
Gets or sets the vertical spacing in pixels between tree nodes. This property controls the gap between adjacent nodes in the tree view.
ToggleMode
Gets or sets the default toggle mode for expanding and collapsing tree nodes. This property determines how users can expand or collapse nodes (single click, double click, etc.).
Declaration
public virtual ToggleMode ToggleMode { get; set; }
Property Value
ToggleStateConverter
Gets or sets a TypeConverter used to convert checkbox toggle states to the underlying data type. This converter is used when binding checkbox states to data source properties.
Declaration
public virtual TypeConverter ToggleStateConverter { get; set; }
Property Value
TopNode
Gets the topmost visible tree node in the tree view control. This property returns the first node that is currently visible in the control's view area.
Declaration
[Browsable(false)]
public RadTreeNode TopNode { get; }
Property Value
TreeIndent
Gets or sets the indentation distance in pixels for each level of tree nodes. This controls the horizontal spacing between parent and child nodes.
TreeViewElement
Gets the underlying tree view element that provides the core functionality for the control. This element contains the main logic and rendering capabilities of the tree view.
Declaration
[Browsable(false)]
public virtual RadTreeViewElement TreeViewElement { get; }
Property Value
TreeViewXml
Gets or sets the XML representation of the tree view structure. This property allows saving and loading the entire tree structure as XML data.
TriStateMode
Gets or sets a value indicating whether tri-state mode is enabled for node checkboxes. When enabled, checkboxes can have three states: checked, unchecked, and indeterminate.
VScrollBar
Gets the vertical scroll bar element of the tree view control. This scroll bar appears when the tree content extends beyond the control's height.
Declaration
[Browsable(false)]
public RadScrollBarElement VScrollBar { get; }
Property Value
ValueMember
Gets or sets the property in the data source that provides the value for each tree node. This property specifies which field from the data source should be used for node values.
VisibleCount
Gets the number of tree nodes that can be fully visible in the tree view control. This count is based on the current size of the control and the height of the nodes.
Declaration
[Browsable(false)]
public int VisibleCount { get; }
Property Value
Methods
AddNodeByPath(string)
Creates a new tree node and adds it at the location specified by the hierarchical path. The path is parsed using the PathSeparator to determine the node hierarchy.
Declaration
public virtual RadTreeNode AddNodeByPath(string path)
Parameters
path
The hierarchical path where the node should be added.
Returns
The newly created RadTreeNode if the operation is successful.
AddNodeByPath(string, string)
Creates a new tree node and adds it at the location specified by the hierarchical path using a custom path separator. The path is parsed using the specified separator to determine the node hierarchy.
Declaration
public virtual RadTreeNode AddNodeByPath(string path, string pathSeparator)
Parameters
path
The hierarchical path where the node should be added.
pathSeparator
The custom path separator to use for parsing the path.
Returns
The newly created RadTreeNode if the operation is successful.
BeginEdit()
Begins edit mode for the currently selected tree node.
Declaration
public bool BeginEdit()
Returns
True if edit mode was successfully started; otherwise, false.
BeginInit()
Suspends layout during initialization.
Declaration
public override void BeginInit()
Overrides
BeginUpdate()
Disables visual updates to the tree view to improve performance during batch operations. Must be paired with a call to EndUpdate().
Declaration
public void BeginUpdate()
BringIntoView(RadTreeNode)
Scrolls the tree view to ensure the specified node is visible within the control's display area.
Declaration
public void BringIntoView(RadTreeNode node)
Parameters
node
The tree node to bring into view.
CancelEdit()
Closes the currently active editor and discards any changes made during editing.
Declaration
public void CancelEdit()
ClearSelection()
Clears the current node selection, deselecting all currently selected nodes.
Declaration
public virtual void ClearSelection()
CollapseAll()
Collapses all tree nodes in the tree view, hiding all child nodes.
Declaration
public void CollapseAll()
CollapseAll(RadTreeNodeCollection)
Collapses all nodes in the specified collection, hiding their child nodes.
Declaration
public void CollapseAll(RadTreeNodeCollection nodes)
Parameters
nodes
The collection of nodes to be collapsed.
CreateAccessibilityInstance()
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
Overrides
CreateChildItems(RadElement)
Creates the child elements that make up the tree view control structure. This method instantiates the main RadTreeViewElement and adds it to the parent container.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
The parent RadElement that will contain the child elements.
Overrides
CreateTreeViewElement()
Creates and returns a new instance of the tree view element that provides the core functionality. This method can be overridden in derived classes to provide custom tree view element implementations.
Declaration
protected virtual RadTreeViewElement CreateTreeViewElement()
Returns
A new RadTreeViewElement instance.
DeferRefresh()
Defers refresh operations for the tree view, returning a disposable object that triggers refresh when disposed. This is useful for batching multiple operations while maintaining automatic cleanup.
Declaration
public virtual IDisposable DeferRefresh()
Returns
An IDisposable object that triggers refresh when disposed.
Dispose(bool)
Releases the unmanaged resources used by the RadTreeView and optionally releases the managed resources. This method cleans up event handlers and disposes of the context menu if it's the default implementation.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Overrides
EndEdit()
Commits any changes and ends the edit operation on the currently edited node.
Declaration
public bool EndEdit()
Returns
True if the edit operation was successfully ended; otherwise, false.
EndUpdate()
Re-enables visual updates to the tree view after a call to BeginUpdate(). This will refresh the tree view display with any changes made during the update period.
Declaration
public void EndUpdate()
Execute(ICommand, params object[])
Executes the specified command on the tree view with optional settings.
Execute(bool, ICommand, params object[])
Executes the specified command on the tree view with control over subtree inclusion.
Declaration
public object Execute(bool includeSubTrees, ICommand command, params object[] settings)
Parameters
includeSubTrees
True to include subtrees in the command execution; otherwise, false.
command
ICommand
The command to execute.
settings
object[]
Optional settings or parameters for the command.
Returns
The result of the command execution, if any.
ExecuteBatchCommand(RadTreeNode, int, ICommand, params object[])
Executes a command over an entire subtree starting with the specified node.
Declaration
public static List<object> ExecuteBatchCommand(RadTreeNode node, int level, ICommand command, params object[] settings)
Parameters
node
The node form which the execuition starts.
level
The level of nodes over which to execute the command. If -1 the entire subtree is traversed.
command
ICommand
The command to execute.
settings
object[]
Parameters to pass the command prior to execution.
Returns
List<object>
The results from the batch execution.
ExecuteBatchCommand(RadTreeNodeCollection, int, ICommand, params object[])
Executes a command over an entire subtree starting with the specified node collection. This static method allows batch operations across multiple tree branches.
Declaration
public static List<object> ExecuteBatchCommand(RadTreeNodeCollection nodes, int level, ICommand command, params object[] settings)
Parameters
nodes
The collection of nodes from which execution starts.
level
The level of nodes over which to execute the command. If -1, the entire subtree is traversed.
command
ICommand
The command to execute on each node.
settings
object[]
Parameters to pass to the command prior to execution.
Returns
List<object>
A list containing the results from the batch execution.
ExecuteScalarCommand(RadTreeNode, int, ICommand, params object[])
Executes a command over an entire subtree starting with the specified node. This static method returns the first result from the batch execution.
Declaration
public static object ExecuteScalarCommand(RadTreeNode node, int level, ICommand command, params object[] settings)
Parameters
node
The node from which execution starts.
level
The level of nodes over which to execute the command. If -1, the entire subtree is traversed.
command
ICommand
The command to execute on each node.
settings
object[]
Parameters to pass to the command prior to execution.
Returns
The first result from the batch execution.
ExpandAll()
Expands all tree nodes in the tree view, revealing all child nodes.
Declaration
public void ExpandAll()
ExpandAll(RadTreeNodeCollection)
Expands all nodes in the specified collection, revealing their child nodes.
Declaration
public virtual void ExpandAll(RadTreeNodeCollection nodes)
Parameters
nodes
The collection of nodes to be expanded.
Find(Predicate<RadTreeNode>)
Searches for the first tree node that matches the specified predicate function.
Declaration
public RadTreeNode Find(Predicate<RadTreeNode> match)
Parameters
match
A predicate function that defines the search criteria.
Returns
The first RadTreeNode that matches the predicate, or null if no match is found.
Find(string)
Searches for the first tree node whose text contains the specified string.
Declaration
public virtual RadTreeNode Find(string text)
Parameters
text
The text to search for within node text.
Returns
The first RadTreeNode containing the specified text, or null if not found.
Find<T>(FindAction<T>, T)
Searches for the first tree node that matches the specified search function with a parameter.
Declaration
public RadTreeNode Find<T>(FindAction<T> match, T arg)
Parameters
match
FindAction<T>
A function that defines the search criteria with a parameter.
arg
T
The argument to pass to the search function.
Returns
The first RadTreeNode that matches the criteria, or null if no match is found.
FindNodes(Predicate<RadTreeNode>)
Searches for all tree nodes that match the specified predicate function.
Declaration
public RadTreeNode[] FindNodes(Predicate<RadTreeNode> match)
Parameters
match
A predicate function that defines the search criteria.
Returns
An array of RadTreeNode objects that match the predicate.
FindNodes(string)
Searches for all tree nodes whose text contains the specified string.
Declaration
public virtual RadTreeNode[] FindNodes(string text)
Parameters
text
The text to search for within node text.
Returns
An array of RadTreeNode objects containing the specified text.
FindNodes<T>(FindAction<T>, T)
Searches for all tree nodes that match the specified search function with a parameter.
Declaration
public RadTreeNode[] FindNodes<T>(FindAction<T> match, T arg)
Parameters
match
FindAction<T>
A function that defines the search criteria with a parameter.
arg
T
The argument to pass to the search function.
Returns
An array of RadTreeNode objects that match the criteria.
ForEach(Action<RadTreeNode>)
Executes the specified action for every tree node in the tree view. The action is applied recursively to all nodes in the tree structure.
Declaration
public void ForEach(Action<RadTreeNode> action)
Parameters
action
The action to execute for each tree node.
GetNodeAt(Point)
Retrieves the tree node located at the specified point in client coordinates.
Declaration
public RadTreeNode GetNodeAt(Point pt)
Parameters
pt
The point to evaluate and retrieve the node from.
Returns
The RadTreeNode at the specified point, or null if no node exists at that location.
GetNodeAt(int, int)
Retrieves the tree node located at the specified coordinates in client coordinates.
Declaration
public RadTreeNode GetNodeAt(int x, int y)
Parameters
x
The X coordinate to evaluate and retrieve the node from.
y
The Y coordinate to evaluate and retrieve the node from.
Returns
The RadTreeNode at the specified location, or null if no node exists at that location.
GetNodeByName(string)
Retrieves the first tree node with the specified name from the entire tree. Searches recursively through all nodes in the tree view.
Declaration
public RadTreeNode GetNodeByName(string name)
Parameters
name
The name of the node to find.
Returns
The first RadTreeNode with the specified name, or null if not found.
GetNodeByName(string, RadTreeNode)
Retrieves the first tree node with the specified name, searching from a specific root node. Searches recursively through the specified root node and its descendants.
Declaration
public RadTreeNode GetNodeByName(string name, RadTreeNode rootNode)
Parameters
name
The name of the node to find.
rootNode
The root node to begin the search from.
Returns
The first RadTreeNode with the specified name, or null if not found.
GetNodeByPath(string)
Retrieves a tree node by following the specified hierarchical path. The path is parsed using the current PathSeparator value.
Declaration
public virtual RadTreeNode GetNodeByPath(string path)
Parameters
path
The hierarchical path to the desired node.
Returns
The RadTreeNode at the specified path, or null if not found.
GetNodeByPath(string, string)
Retrieves a tree node by following the specified hierarchical path using a custom path separator. The path is parsed using the specified separator to locate the node.
Declaration
public virtual RadTreeNode GetNodeByPath(string path, string pathSeparator)
Parameters
path
The hierarchical path to the desired node.
pathSeparator
The custom path separator to use for parsing the path.
Returns
The RadTreeNode at the specified path, or null if not found.
GetNodeCount(bool)
Retrieves the total number of tree nodes in the tree view control.
LoadXML(Stream, params Type[])
Loads tree view structure from an XML stream with support for additional custom types.
LoadXML(string, params Type[])
Loads tree view structure from an XML file with support for additional custom types.
LoadXMLWithReader(XmlReader, params Type[])
Loads tree view structure from an XML reader with support for additional custom types.
OnBindingContextChanged(EventArgs)
Declaration
protected override void OnBindingContextChanged(EventArgs e)
Parameters
e
Overrides
OnClick(EventArgs)
Declaration
protected override void OnClick(EventArgs e)
Parameters
e
Overrides
OnGotFocus(EventArgs)
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
e
Overrides
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
Overrides
OnKeyPress(KeyPressEventArgs)
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
e
Overrides
OnLoad(Size)
Handles the load event and enables pan gesture support for touch interactions. This method is called when the control is loaded and initializes gesture-based navigation.
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
desiredSize
The desired size for the control.
Overrides
OnLostFocus(EventArgs)
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
e
Overrides
OnMouseClick(MouseEventArgs)
Declaration
protected override void OnMouseClick(MouseEventArgs e)
Parameters
e
Overrides
OnMouseDoubleClick(MouseEventArgs)
Declaration
protected override void OnMouseDoubleClick(MouseEventArgs e)
Parameters
e
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
Overrides
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
e
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
e
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
e
Overrides
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
e
Overrides
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Handles property change notifications and updates the tree view as needed.
Declaration
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
e
The property change event arguments.
Overrides
OnThemeNameChanged(ThemeNameChangedEventArgs)
Processes Windows theme changes and updates the tree view appearance accordingly.
Declaration
protected override void OnThemeNameChanged(ThemeNameChangedEventArgs e)
Parameters
e
The theme change event arguments.
Overrides
ProcessCodedUIMessage(ref IPCMessage)
Declaration
protected override void ProcessCodedUIMessage(ref IPCMessage request)
Parameters
request
IPCMessage
Overrides
SaveXML(Stream, params Type[])
Saves the tree view structure to an XML stream with support for additional custom types.
SaveXML(string, params Type[])
Saves the tree view structure to an XML file with support for additional custom types.
SaveXMLWithWriter(TextWriter, params Type[])
Saves the tree view structure to an XML writer with support for additional custom types.
Declaration
protected virtual void SaveXMLWithWriter(TextWriter writer, params Type[] extraTypes)
Parameters
writer
The text writer to save XML data to.
extraTypes
Type[]
Additional types that should be included in XML serialization.
SelectAll()
Selects all tree nodes in the tree view when MultiSelect is enabled.
Declaration
public virtual void SelectAll()
SetError(string, RadTreeNode)
Sets an error message for a specific tree node, typically used for validation feedback.
Declaration
public void SetError(string text, RadTreeNode radTreeNode)
Parameters
text
The error message text to display.
radTreeNode
The tree node to associate with the error.
ToString()
Returns a string representation of this tree view control, including node count information.
Declaration
public override string ToString()
Returns
A string that represents the current tree view control.
Overrides
UnwireEvents()
Removes event handler connections for the tree view control during cleanup. This method unsubscribes from events to prevent memory leaks when the control is disposed.
Declaration
protected virtual void UnwireEvents()
WireEvents()
Establishes event handler connections for the tree view control. This method subscribes to essential events like SelectedNodeChanged for proper functionality.
Declaration
protected virtual void WireEvents()
WndProc(ref Message)
Processes Windows messages for the tree view control, including context menu handling.
Declaration
protected override void WndProc(ref Message m)
Parameters
m
The Windows message to process.
Overrides
Events
ContextMenuOpening
Occurs when a context menu is about to be opened for the tree view. This event allows customization of the context menu before it is displayed.
Declaration
public event TreeViewContextMenuOpeningEventHandler ContextMenuOpening
Event Value
CreateNode
Occurs when a new tree node is about to be created during data binding or programmatic operations. This event allows customization of node creation and assignment of custom node types.
Declaration
public event CreateTreeNodeEventHandler CreateNode
Event Value
CreateNodeElement
Occurs when a new tree node element is about to be created for visual rendering. This event allows customization of the visual element that represents a tree node.
Declaration
public event CreateTreeNodeElementEventHandler CreateNodeElement
Event Value
DataError
Occurs when a data binding error is encountered during tree view operations. This event allows handling and responding to data-related errors gracefully.
Declaration
public event TreeNodeDataErrorEventHandler DataError
Event Value
DragEnded
Occurs after a drag operation has completed successfully. This event is raised when nodes have been moved or copied to their new location.
Declaration
public event RadTreeView.DragEndedHandler DragEnded
Event Value
DragEnding
Occurs when a drag operation is about to end, allowing cancellation of the drop operation. This event provides an opportunity to validate and potentially cancel the drag operation.
Declaration
public event RadTreeView.DragEndingHandler DragEnding
Event Value
DragOverNode
Occurs when dragged content is positioned over a tree node during a drag operation. This event allows customization of visual feedback and validation of drop targets.
Declaration
public event EventHandler<RadTreeViewDragCancelEventArgs> DragOverNode
Event Value
DragStarted
Occurs after a drag operation has begun and the node is being dragged. This event indicates that the drag operation is now active.
Declaration
public event RadTreeView.DragStartedHandler DragStarted
Event Value
DragStarting
Occurs when a drag operation is about to begin, allowing cancellation of the operation. This event provides an opportunity to prevent certain nodes from being dragged.
Declaration
public event RadTreeView.DragStartingHandler DragStarting
Event Value
Edited
Occurs after a tree node has finished being edited and the changes have been applied. This event provides access to the edited node and the new value.
Declaration
public event TreeNodeEditedEventHandler Edited
Event Value
Editing
Occurs before a tree node enters edit mode for text editing. This event allows validation and cancellation of the editing operation.
Declaration
public event TreeNodeEditingEventHandler Editing
Event Value
EditorInitialized
Occurs when the active editor for node editing has been initialized. This event allows customization of the editor after it has been created and configured.
Declaration
public event TreeNodeEditorInitializedEventHandler EditorInitialized
Event Value
EditorRequired
Occurs when the tree view requires an editor for node editing operations. This event allows custom editor selection and configuration for different node types.
Declaration
[Browsable(true)]
public event RadTreeView.EditorRequiredHandler EditorRequired
Event Value
ItemDrag
Occurs when the user begins dragging a tree node. This event is raised at the start of a drag operation when AllowDragDrop is enabled.
Declaration
public event RadTreeView.ItemDragHandler ItemDrag
Event Value
NodeAdded
Occurs after a tree node has been added to the tree view. This event provides access to the newly added node for initialization or logging purposes.
Declaration
[Browsable(true)]
public event RadTreeView.RadTreeViewEventHandler NodeAdded
Event Value
NodeAdding
Occurs before a tree node is added to the tree view, allowing cancellation of the operation. This event provides an opportunity to validate or prevent node addition.
Declaration
[Browsable(true)]
public event RadTreeView.RadTreeViewCancelEventHandler NodeAdding
Event Value
NodeCheckedChanged
Occurs after the checked state of a tree node has changed. This event is raised when CheckBoxes is enabled and a node's check state has been modified.
Declaration
public virtual event TreeNodeCheckedEventHandler NodeCheckedChanged
Event Value
NodeCheckedChanging
Occurs before the checked state of a tree node changes, allowing cancellation of the operation. This event is raised when CheckBoxes is enabled and a node's check state is about to change.
Declaration
public virtual event RadTreeView.RadTreeViewCancelEventHandler NodeCheckedChanging
Event Value
NodeDataBound
Occurs after a tree node has been bound to a data item during data binding operations. This event allows customization of the node after it has been populated with data.
Declaration
[Browsable(true)]
public event RadTreeView.RadTreeViewEventHandler NodeDataBound
Event Value
NodeExpandedChanged
Occurs after a tree node has been expanded or collapsed. This event is raised when the expanded state of a node has been successfully changed.
Declaration
[Browsable(true)]
public event RadTreeView.TreeViewEventHandler NodeExpandedChanged
Event Value
NodeExpandedChanging
Occurs before a tree node is expanded or collapsed, allowing cancellation of the operation. This event provides an opportunity to validate or prevent expand/collapse actions.
Declaration
[Browsable(true)]
public event RadTreeView.RadTreeViewCancelEventHandler NodeExpandedChanging
Event Value
NodeFormatting
Occurs when a tree node needs to be formatted for display. This event allows customization of node appearance based on state or data.
Declaration
public event TreeNodeFormattingEventHandler NodeFormatting
Event Value
NodeMouseClick
Occurs when a mouse button is clicked on a tree node. This event provides access to the clicked node and mouse event details.
Declaration
public event RadTreeView.TreeViewEventHandler NodeMouseClick
Event Value
NodeMouseDoubleClick
Occurs when a mouse button is double-clicked on a tree node. This event provides access to the double-clicked node and mouse event details.
Declaration
public event RadTreeView.TreeViewEventHandler NodeMouseDoubleClick
Event Value
NodeMouseDown
Occurs when the user presses a mouse button while the cursor is over a tree node. This event provides access to the specific node and mouse button information.
Declaration
public event RadTreeView.TreeViewMouseEventHandler NodeMouseDown
Event Value
NodeMouseEnter
Occurs when the mouse cursor enters the area of a tree node. This event is useful for implementing custom hover effects or tooltips.
Declaration
public event RadTreeView.TreeViewEventHandler NodeMouseEnter
Event Value
NodeMouseHover
Occurs when the mouse cursor hovers over a tree node for an extended period. This event is typically used for displaying detailed tooltips or information.
Declaration
public event RadTreeView.TreeViewEventHandler NodeMouseHover
Event Value
NodeMouseLeave
Occurs when the mouse cursor leaves the area of a tree node. This event is useful for cleaning up hover effects or hiding tooltips.
Declaration
public event RadTreeView.TreeViewEventHandler NodeMouseLeave
Event Value
NodeMouseMove
Occurs when the user moves the mouse cursor within the area of a tree node. This event provides access to the specific node and mouse position information.
Declaration
public event RadTreeView.TreeViewMouseEventHandler NodeMouseMove
Event Value
NodeMouseUp
Occurs when the user releases a mouse button while the cursor is over a tree node. This event provides access to the specific node and mouse button information.
Declaration
public event RadTreeView.TreeViewMouseEventHandler NodeMouseUp
Event Value
NodeRemoved
Occurs after a tree node has been removed from the tree view. This event provides access to the removed node for cleanup or logging purposes.
Declaration
[Browsable(true)]
public event RadTreeView.RadTreeViewEventHandler NodeRemoved
Event Value
NodeRemoving
Occurs before a tree node is removed from the tree view, allowing cancellation of the operation. This event provides an opportunity to validate or prevent node removal.
Declaration
[Browsable(true)]
public event RadTreeView.RadTreeViewCancelEventHandler NodeRemoving
Event Value
NodesNeeded
Occurs when child nodes need to be loaded in lazy loading mode. This event is raised when LazyMode is enabled and a node is expanded for the first time.
Declaration
[Browsable(true)]
public event NodesNeededEventHandler NodesNeeded
Event Value
SelectedNodeChanged
Occurs after a tree node has been selected. This event is raised when the SelectedNode property changes.
Declaration
public virtual event RadTreeView.RadTreeViewEventHandler SelectedNodeChanged
Event Value
SelectedNodeChanging
Occurs before a tree node selection changes, allowing cancellation of the selection. This event provides an opportunity to validate and potentially prevent node selection.
Declaration
public virtual event RadTreeView.RadTreeViewCancelEventHandler SelectedNodeChanging
Event Value
SelectedNodesChanged
Occurs when the SelectedNodes collection has been modified. This event is raised when nodes are added to or removed from the selection.
Declaration
public virtual event EventHandler<RadTreeViewEventArgs> SelectedNodesChanged
Event Value
SelectedNodesCleared
Occurs when all selected nodes have been cleared from the SelectedNodes collection. This event is raised when the selection is programmatically or interactively cleared.
Declaration
public virtual event EventHandler SelectedNodesCleared
Event Value
ShowExpander
Occurs when the tree view needs to determine whether to show an expander for a node in lazy loading mode. This event is raised when LazyMode is enabled and the control needs to display expand indicators.
Declaration
public event RadTreeView.TreeViewShowExpanderEventHandler ShowExpander
Event Value
ValidationError
Occurs when editor validation fails during the node editing process. This event is raised when the entered value does not meet validation criteria.
Declaration
[Browsable(true)]
public event EventHandler ValidationError
Event Value
ValueChanged
Occurs when the editor has finished editing and the new value has been committed. This event is raised after the node value has been successfully changed.
Declaration
[Browsable(true)]
public event TreeNodeValueChangedEventHandler ValueChanged
Event Value
ValueChanging
Occurs when the editor value is in the process of being changed during node editing. This event allows validation and modification of the value before it is committed.
Declaration
public event TreeNodeValueChangingEventHandler ValueChanging
Event Value
ValueValidating
Occurs when the editor value is being validated during the editing process. This event allows custom validation logic and can prevent invalid values from being accepted.
Declaration
[Browsable(true)]
public event TreeNodeValidatingEventHandler ValueValidating
Event Value