Class
RadTreeNode

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
public class RadTreeNode : IDataItem, ICloneable, INotifyPropertyChanged

Inheritance: objectRadTreeNode

Derived Classes: FileBrowserTreeNodeDataFilterAddNodeDataFilterCriteriaNodeDataFilterGroupNodeFieldTreeNode

Implements: ICloneableIDataItemINotifyPropertyChanged

Constructors

RadTreeNode()

Declaration

cs-api-definition
public RadTreeNode()

RadTreeNode(string)

Declaration

cs-api-definition
public RadTreeNode(string text)

Parameters

text

string

RadTreeNode(string, Image)

Declaration

cs-api-definition
public RadTreeNode(string text, Image image)

Parameters

text

string

image

Image

RadTreeNode(string, Image, bool)

Declaration

cs-api-definition
public RadTreeNode(string text, Image image, bool expanded)

Parameters

text

string

image

Image

expanded

bool

RadTreeNode(string, RadTreeNode[])

Declaration

cs-api-definition
public RadTreeNode(string text, RadTreeNode[] children)

Parameters

text

string

children

RadTreeNode[]

RadTreeNode(string, bool)

Initializes new instance of the RadTreeNode class.

Declaration

cs-api-definition
public RadTreeNode(string text, bool expanded)

Parameters

text

string

The text to be used as label text.

expanded

bool

A boolean value indicating whether the node is expanded.

Fields

IsAllowDropState

Declaration

cs-api-definition
protected const int IsAllowDropState = 64

Field Value

int

IsCurrentState

Declaration

cs-api-definition
protected const int IsCurrentState = 8

Field Value

int

IsEnableState

Declaration

cs-api-definition
protected const int IsEnableState = 32

Field Value

int

IsExpandedState

Declaration

cs-api-definition
protected const int IsExpandedState = 2

Field Value

int

IsSelectedState

Declaration

cs-api-definition
protected const int IsSelectedState = 4

Field Value

int

IsVisibleState

Declaration

cs-api-definition
protected const int IsVisibleState = 16

Field Value

int

SuspendNotificationsState

Declaration

cs-api-definition
protected const int SuspendNotificationsState = 1

Field Value

int

UpdateParentSizeOnExpandedChangedState

Declaration

cs-api-definition
protected const int UpdateParentSizeOnExpandedChangedState = 128

Field Value

int

cachedIndex

Declaration

cs-api-definition
protected int cachedIndex

Field Value

int

state

Declaration

cs-api-definition
protected BitVector32 state

Field Value

BitVector32

Properties

ActualSize

Gets or sets the measured desired width for this node.

Declaration

cs-api-definition
[Browsable(false)]
public Size ActualSize { get; }

Property Value

Size

AllowDrop

Gets or sets a value indicating whether [allow drop].

Declaration

cs-api-definition
[Browsable(false)]
public bool AllowDrop { get; set; }

Property Value

bool

true if [allow drop]; otherwise, false.

BackColor

Gets or sets the backcolor of the tree node. Color type represents an ARGB color.

Declaration

cs-api-definition
public Color BackColor { get; set; }

Property Value

Color

BackColor2

Gets or sets the backcolor of the tree node. This property is applicable to radial, glass, office glass, gel, and vista gradients.

Declaration

cs-api-definition
public Color BackColor2 { get; set; }

Property Value

Color

BackColor3

Gets or sets the backcolor of the tree node. This property is applicable to radial, glass, office glass, and vista gradients.

Declaration

cs-api-definition
public Color BackColor3 { get; set; }

Property Value

Color

BackColor4

Gets or sets the backcolor of the tree node. This property is applicable to radial, glass, office glass, and vista gradients.

Declaration

cs-api-definition
public Color BackColor4 { get; set; }

Property Value

Color

BorderColor

Gets or sets the border color of the tree node.

Declaration

cs-api-definition
public Color BorderColor { get; set; }

Property Value

Color

CheckState

Gets or sets the state of the check element.

Declaration

cs-api-definition
public virtual ToggleState CheckState { get; set; }

Property Value

ToggleState

The state of the check.

CheckType

Gets or sets the type of the check element.

Declaration

cs-api-definition
public CheckType CheckType { get; set; }

Property Value

CheckType

The type of the check.

Checked

Gets or sets a value indicating whether this RadTreeNode is checked.

Declaration

cs-api-definition
public bool Checked { get; set; }

Property Value

bool

true if checked; otherwise, false.

ChildrenSize

Gets or sets the measured desired width for this node.

Declaration

cs-api-definition
[Browsable(false)]
public Size ChildrenSize { get; }

Property Value

Size

ContextMenu

Gets or sets the context menu associated to the node.

Declaration

cs-api-definition
public virtual RadContextMenu ContextMenu { get; set; }

Property Value

RadContextMenu

Returns an instance of RadDropDownMenu that is associated with the node. The default value is null.

Remarks

This property could be used to associate a custom menu and replace the treeview's default. If the context menu is invoked by right-clicking a node, the treeview's menu will not be shown and the context menu assigned to this node will be shown instead.

Current

Gets or sets a value indicating whether this instance is current.

Declaration

cs-api-definition
[Browsable(false)]
public bool Current { get; set; }

Property Value

bool

true if this instance is current; otherwise, false.

DataBoundItem

Gets the data-bound object that populated the node.

Declaration

cs-api-definition
[Browsable(false)]
public object DataBoundItem { get; }

Property Value

object

Enabled

Gets or sets a value indicating whether the node can respond to user interaction.

Declaration

cs-api-definition
public bool Enabled { get; set; }

Property Value

bool

The default value is true.

Expanded

Gets or sets a value indicating whether this instance is expanded.

Declaration

cs-api-definition
[Browsable(false)]
public bool Expanded { get; set; }

Property Value

bool

true if this instance is expanded; otherwise, false.

FirstNode

Gets the first node.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode FirstNode { get; }

Property Value

RadTreeNode

The first node.

Font

Gets or sets the font of the node text.

Declaration

cs-api-definition
public Font Font { get; set; }

Property Value

Font

The default value is null.

ForeColor

Gets or sets the foreground color of the tree node. This color is applied to the text label.

Declaration

cs-api-definition
public virtual Color ForeColor { get; set; }

Property Value

Color

FullPath

Gets the full path.

Declaration

cs-api-definition
[Browsable(false)]
public string FullPath { get; }

Property Value

string

The full path.

GradientAngle

Gets or sets gradient angle for linear gradient.

Declaration

cs-api-definition
public float GradientAngle { get; set; }

Property Value

float

The default value is 90.0.

GradientPercentage

Gets or sets GradientPercentage for linear, glass, office glass, gel, vista, and radial gradients.

Declaration

cs-api-definition
public float GradientPercentage { get; set; }

Property Value

float

The default value is 0.5.

GradientPercentage2

Gets or sets GradientPercentage for office glass, vista, and radial gradients.

Declaration

cs-api-definition
public float GradientPercentage2 { get; set; }

Property Value

float

The default value is 0.5.

GradientStyle

Gets and sets the gradient style. The possible values are defined in the gradient style enumeration: solid, linear, radial, glass, office glass, gel, and vista.

Declaration

cs-api-definition
public GradientStyles GradientStyle { get; set; }

Property Value

GradientStyles

The default value is GradientStyles.

HasStyle

Gets a value indicating whether this instance has style.

Declaration

cs-api-definition
[Browsable(false)]
public bool HasStyle { get; }

Property Value

bool

true if this instance has style; otherwise, false.

Image

Gets or sets the image of the node.

Declaration

cs-api-definition
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image Image { get; set; }

Property Value

Image

ImageIndex

Gets or sets the left image list index value of the image displayed when the tree node is not selected.

Declaration

cs-api-definition
[RelatedImageList("TreeView.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

int

ImageKey

Gets or sets the key for the left image associated with this tree node.

Declaration

cs-api-definition
[RelatedImageList("TreeView.ImageList")]
[TypeConverter("Telerik.WinControls.UI.Design.RadImageKeyConverter, Telerik.WinControls.UI.Design, Version=2026.1.217.48, Culture=neutral, PublicKeyToken=5bb2a467cbec794e")]
public string ImageKey { get; set; }

Property Value

string

Index

Gets the index.

Declaration

cs-api-definition
[Browsable(false)]
public virtual int Index { get; }

Property Value

int

The index.

IsEditing

Gets a value indicating whether this instance is editing.

Declaration

cs-api-definition
[Browsable(false)]
public bool IsEditing { get; }

Property Value

bool

true if this instance is editing; otherwise, false.

IsInDesignMode

Gets or a value indicating whether the control is in design mode.

Declaration

cs-api-definition
[Browsable(false)]
public bool IsInDesignMode { get; }

Property Value

bool

ItemHeight

Gets or sets the height of the tree node in the tree view control.

Declaration

cs-api-definition
[Browsable(true)]
public int ItemHeight { get; set; }

Property Value

int

The default value is 20.

LastNode

Gets the last node.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode LastNode { get; }

Property Value

RadTreeNode

The last node.

Level

Gets the level.

Declaration

cs-api-definition
[Browsable(false)]
public int Level { get; }

Property Value

int

The level.

Matches

Gets the last matches using Find method.

Declaration

cs-api-definition
[Browsable(false)]
public IEnumerator<RadTreeNode> Matches { get; }

Property Value

IEnumerator<RadTreeNode>

Gets the last matches using Find method.

Name

Gets or sets the name of the RadTreeNode.

Declaration

cs-api-definition
[Browsable(true)]
public string Name { get; set; }

Property Value

string

A String that represents the name of the tree node.

Remarks

The Name of a TreeNode is also the node's key, when the node is part of a RadTreeNodeCollection. If the node does not have a name, Name returns an empty string ("").

NextNode

Gets the next node.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode NextNode { get; }

Property Value

RadTreeNode

The next node.

NextVisibleNode

Gets the next visible node.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode NextVisibleNode { get; }

Property Value

RadTreeNode

The next visible node.

Nodes

Gets the nodes.

Declaration

cs-api-definition
[ListBindable(false)]
[Browsable(true)]
public RadTreeNodeCollection Nodes { get; }

Property Value

RadTreeNodeCollection

The nodes.

NumberOfColors

Gets or sets the number of used colors in the gradient effect.

Declaration

cs-api-definition
public int NumberOfColors { get; set; }

Property Value

int

The default value is 4.

Parent

Gets or sets the parent.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode Parent { get; }

Property Value

RadTreeNode

The parent.

PrevNode

Gets the prev node.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode PrevNode { get; }

Property Value

RadTreeNode

The prev node.

PrevVisibleNode

Gets the prev visible node.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode PrevVisibleNode { get; }

Property Value

RadTreeNode

The prev visible node.

RootNode

Gets the root parent node for this RadTreeView.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeNode RootNode { get; }

Property Value

RadTreeNode

The default value is null.

Selected

Gets or sets a value indicating whether this instance is selected.

Declaration

cs-api-definition
[Browsable(false)]
public bool Selected { get; set; }

Property Value

bool

true if this instance is selected; otherwise, false.

Style

Gets the style.

Declaration

cs-api-definition
[Browsable(false)]
public TreeNodeStyle Style { get; }

Property Value

TreeNodeStyle

The style.

SvgImage

Gets or sets the vector image of the node.

Declaration

cs-api-definition
[TypeConverter(typeof(SvgImageTypeConverter))]
public virtual RadSvgImage SvgImage { get; set; }

Property Value

RadSvgImage

Tag

Gets or sets the tag object that can be used to store user data, corresponding to the tree node.

Declaration

cs-api-definition
[Bindable(true)]
[TypeConverter(typeof(StringConverter))]
public object Tag { get; set; }

Property Value

object

The tag.

Text

Gets or sets the text.

Declaration

cs-api-definition
public string Text { get; set; }

Property Value

string

The text.

TextAlignment

Gets or sets the text alignment.

Declaration

cs-api-definition
public ContentAlignment TextAlignment { get; set; }

Property Value

ContentAlignment

The default value is ContentAlignment.MiddleLeft.

ToolTipText

Gets or sets the text that appears when the mouse pointer hovers over a tree node.

Declaration

cs-api-definition
public string ToolTipText { get; set; }

Property Value

string

The default value is "".

TreeView

Gets the parent tree view that the tree node is assigned to.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeView TreeView { get; }

Property Value

RadTreeView

TreeViewElement

Gets or sets the tree view element.

Declaration

cs-api-definition
[Browsable(false)]
public RadTreeViewElement TreeViewElement { get; }

Property Value

RadTreeViewElement

The tree view element.

Value

Gets or sets the node value.

Declaration

cs-api-definition
public virtual object Value { get; set; }

Property Value

object

The text.

Visible

Gets or sets a value indicating whether this instance is visible.

Declaration

cs-api-definition
public virtual bool Visible { get; set; }

Property Value

bool

true if this instance is visible; otherwise, false.

Methods

BeginEdit()

Initiates the editing of the tree node.

Declaration

cs-api-definition
public bool BeginEdit()

Returns

bool

CacheLastFind(List<RadTreeNode>)

Declaration

cs-api-definition
protected void CacheLastFind(List<RadTreeNode> nodes)

Parameters

nodes

List<RadTreeNode>

CancelEdit()

Cancels the edit.

Declaration

cs-api-definition
public bool CancelEdit()

Returns

bool

Clone()

Creates a new object that is a copy of the current instance.

Declaration

cs-api-definition
public object Clone()

Returns

object

A new object that is a copy of this instance.

Implements ICloneable.Clone()

Collapse()

Collapses the tree node.

Declaration

cs-api-definition
public void Collapse()

Collapse(bool)

Collapses the RadTreeNode and optionally collapses its children.

Declaration

cs-api-definition
public void Collapse(bool ignoreChildren)

Parameters

ignoreChildren

bool

if set to true [ignore children].

EndEdit()

Ends the edit.

Declaration

cs-api-definition
public bool EndEdit()

Returns

bool

EnsureVisible()

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

Declaration

cs-api-definition
public void EnsureVisible()

Execute(ICommand, params object[])

Executes the specified command.

Declaration

cs-api-definition
public object Execute(ICommand command, params object[] settings)

Parameters

command

ICommand

The command.

settings

object[]

The settings.

Returns

object

Execute(bool, ICommand, params object[])

Executes the specified command include sub trees.

Declaration

cs-api-definition
public object Execute(bool includeSubTrees, ICommand command, params object[] settings)

Parameters

includeSubTrees

bool

if set to true [include sub trees].

command

ICommand

The command.

settings

object[]

The settings.

Returns

object

Expand()

Expands the tree node.

Declaration

cs-api-definition
public void Expand()

ExpandAll()

Expands all the child tree nodes.

Declaration

cs-api-definition
public void ExpandAll()

Find(Predicate<RadTreeNode>)

Finds the specified match.

Declaration

cs-api-definition
public RadTreeNode Find(Predicate<RadTreeNode> match)

Parameters

match

Predicate<RadTreeNode>

The match.

Returns

RadTreeNode

Find<T>(FindAction<T>, T)

Declaration

cs-api-definition
public RadTreeNode Find<T>(FindAction<T> match, T arg)

Parameters

match

FindAction<T>

arg

T

Returns

RadTreeNode

FindNodes(Predicate<RadTreeNode>)

Finds the nodes.

Declaration

cs-api-definition
public RadTreeNode[] FindNodes(Predicate<RadTreeNode> match)

Parameters

match

Predicate<RadTreeNode>

The match.

Returns

RadTreeNode[]

FindNodes<T>(FindAction<T>, T)

Finds the nodes.

Declaration

cs-api-definition
public RadTreeNode[] FindNodes<T>(FindAction<T> match, T arg)

Parameters

match

FindAction<T>

The match.

arg

T

The argument.

Returns

RadTreeNode[]

ForEach(Action<RadTreeNode>)

Execute the action for every RadTreeNode in the branch

Declaration

cs-api-definition
public void ForEach(Action<RadTreeNode> action)

Parameters

action

Action<RadTreeNode>

GetFullPath(StringBuilder, string)

Declaration

cs-api-definition
protected virtual void GetFullPath(StringBuilder path, string pathSeparator)

Parameters

path

StringBuilder

pathSeparator

string

GetNodeCount(bool)

Returns the number of child tree nodes.

Declaration

cs-api-definition
public int GetNodeCount(bool includeSubTrees)

Parameters

includeSubTrees

bool

if set to true [include sub trees].

Returns

int

InvalidateOnState()

Declaration

cs-api-definition
public void InvalidateOnState()

InvalidateOnState(bool)

Declaration

cs-api-definition
public void InvalidateOnState(bool recursive)

Parameters

recursive

bool

NotifyExpandedChanged(RadTreeNode)

Declaration

cs-api-definition
protected virtual void NotifyExpandedChanged(RadTreeNode node)

Parameters

node

RadTreeNode

OnCheckStateChanged()

Declaration

cs-api-definition
protected virtual void OnCheckStateChanged()

OnCheckStateChanged(CheckedMode)

Declaration

cs-api-definition
protected virtual void OnCheckStateChanged(CheckedMode checkedMode)

Parameters

checkedMode

CheckedMode

OnDataBoundItemChanged(object, object)

Declaration

cs-api-definition
protected virtual void OnDataBoundItemChanged(object oldItem, object newItem)

Parameters

oldItem

object

newItem

object

OnNotifyPropertyChanged(PropertyChangedEventArgs)

Declaration

cs-api-definition
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs args)

Parameters

args

PropertyChangedEventArgs

OnNotifyPropertyChanged(string)

Declaration

cs-api-definition
protected virtual void OnNotifyPropertyChanged(string name)

Parameters

name

string

Remove()

Removes the current tree node from the tree view control.

Declaration

cs-api-definition
public virtual void Remove()

ResumePropertyNotifications()

Resumes property notifications after a previous SuspendPropertyNotifications() call.

Declaration

cs-api-definition
public void ResumePropertyNotifications()

SetBooleanProperty(string, int, bool)

Declaration

cs-api-definition
protected virtual bool SetBooleanProperty(string propertyName, int propertyKey, bool value)

Parameters

propertyName

string

propertyKey

int

value

bool

Returns

bool

SetBoundChildNodesList(IBindingList)

Sets the IBindingList which holds the child nodes in Object Relational Binding mode

Declaration

cs-api-definition
protected virtual void SetBoundChildNodesList(IBindingList bindingList)

Parameters

bindingList

IBindingList

SetCheckStateCore(ToggleState)

Declaration

cs-api-definition
protected virtual bool SetCheckStateCore(ToggleState value)

Parameters

value

ToggleState

Returns

bool

SuspendPropertyNotifications()

Allows PropertyChanged notifications to be temporary suspended.

Declaration

cs-api-definition
public void SuspendPropertyNotifications()

ToString()

Returns a string that represents the tree node.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string that represents the tree node.

Overrides object.ToString()

Toggle()

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

Declaration

cs-api-definition
public void Toggle()

UpdateChildrenCheckState()

Declaration

cs-api-definition
protected virtual void UpdateChildrenCheckState()

UpdateParentCheckState()

Declaration

cs-api-definition
protected virtual void UpdateParentCheckState()

Events

PropertyChanged

Declaration

cs-api-definition
public event PropertyChangedEventHandler PropertyChanged

Event Value

PropertyChangedEventHandler

Implements INotifyPropertyChanged.PropertyChanged

In this article
DefinitionConstructorsRadTreeNode()RadTreeNode(string)RadTreeNode(string, Image)RadTreeNode(string, Image, bool)RadTreeNode(string, RadTreeNode[])RadTreeNode(string, bool)FieldsIsAllowDropStateIsCurrentStateIsEnableStateIsExpandedStateIsSelectedStateIsVisibleStateSuspendNotificationsStateUpdateParentSizeOnExpandedChangedStatecachedIndexstatePropertiesActualSizeAllowDropBackColorBackColor2BackColor3BackColor4BorderColorCheckStateCheckTypeCheckedChildrenSizeContextMenuCurrentDataBoundItemEnabledExpandedFirstNodeFontForeColorFullPathGradientAngleGradientPercentageGradientPercentage2GradientStyleHasStyleImageImageIndexImageKeyIndexIsEditingIsInDesignModeItemHeightLastNodeLevelMatchesNameNextNodeNextVisibleNodeNodesNumberOfColorsParentPrevNodePrevVisibleNodeRootNodeSelectedStyleSvgImageTagTextTextAlignmentToolTipTextTreeViewTreeViewElementValueVisibleMethodsBeginEdit()CacheLastFind(List<RadTreeNode>)CancelEdit()Clone()Collapse()Collapse(bool)EndEdit()EnsureVisible()Execute(ICommand, params object[])Execute(bool, ICommand, params object[])Expand()ExpandAll()Find(Predicate<RadTreeNode>)Find<T>(FindAction<T>, T)FindNodes(Predicate<RadTreeNode>)FindNodes<T>(FindAction<T>, T)ForEach(Action<RadTreeNode>)GetFullPath(StringBuilder, string)GetNodeCount(bool)InvalidateOnState()InvalidateOnState(bool)NotifyExpandedChanged(RadTreeNode)OnCheckStateChanged()OnCheckStateChanged(CheckedMode)OnDataBoundItemChanged(object, object)OnNotifyPropertyChanged(PropertyChangedEventArgs)OnNotifyPropertyChanged(string)Remove()ResumePropertyNotifications()SetBooleanProperty(string, int, bool)SetBoundChildNodesList(IBindingList)SetCheckStateCore(ToggleState)SuspendPropertyNotifications()ToString()Toggle()UpdateChildrenCheckState()UpdateParentCheckState()EventsPropertyChanged
Not finding the help you need?
Contact Support