New to Telerik UI for WinForms? Start a free 30-day trial

Provides the mutable child-node list and its current sorted or filtered view for a tree node.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class TreeNodeView : IEnumerable

Inheritance: objectTreeNodeView

Implements: IEnumerable

Constructors

Creates a node view backed by the specified node's child collection.

C#
public TreeNodeView(RadTreeNode owner)
Parameters:ownerRadTreeNode

The node whose children are exposed by this view.

Properties

Gets the number of nodes currently present in the sorted or filtered view.

C#
public int Count { get; }

Gets whether the backing child collection is empty, regardless of filtering.

C#
protected bool IsEmpty { get; }

Gets whether the view is read-only; it returns false because this list supports node changes.

C#
public bool IsReadOnly { get; }

Gets or replaces a node at an index in the current view.

C#
public RadTreeNode this[int index] { get; set; }
Parameters:indexint

The zero-based index in the current view.

Property Value:

The node at the specified view position.

Methods

Adds a node to the backing child collection; the active filter controls whether it appears in the current view.

C#
public void Add(RadTreeNode item)
Parameters:itemRadTreeNode

The node to add.

Removes all nodes from the backing child collection and its current view.

C#
public void Clear()

Determines whether a node is present in the current view.

C#
public bool Contains(RadTreeNode item)
Parameters:itemRadTreeNode

The node to locate.

Returns:

bool

true if the node is present in the view; otherwise, false.

Copies the current view, in its current order, into an array.

C#
public void CopyTo(RadTreeNode[] array, int arrayIndex)
Parameters:arrayRadTreeNode[]

The destination array.

arrayIndexint

The zero-based destination index at which copying begins.

Creates an enumerator over the current sorted or filtered view.

C#
public IEnumerator<RadTreeNode> GetEnumerator()
Returns:

IEnumerator<RadTreeNode>

An enumerator for the current view order.

Creates an enumerator that supports forward and backward traversal of the current view.

C#
public ITreeNodeEnumerator GetNodeEnumerator()
Returns:

ITreeNodeEnumerator

An enumerator for the current view.

In a sorted view, the first call to MoveNext() skips the first node.

Creates an enumerator with the specified view entry as its current node.

C#
public ITreeNodeEnumerator GetNodeEnumerator(int position)
Parameters:positionint

The zero-based index of the entry to select.

Returns:

ITreeNodeEnumerator

An enumerator for the current view.

When the view is sorted, advancing the returned enumerator with MoveNext() or MovePrev() throws InvalidCastException.

Creates an enumerator positioned at the specified node when it is present in the current view.

C#
public ITreeNodeEnumerator GetNodeEnumerator(RadTreeNode node)
Parameters:nodeRadTreeNode

The node to select as the current entry.

Returns:

ITreeNodeEnumerator

An enumerator for the current view.

Gets a node's index in the current view, which may differ from its position in the backing collection.

C#
public int IndexOf(RadTreeNode item)
Parameters:itemRadTreeNode

The node to locate.

Returns:

int

The node's index in the current view, or -1 if it is not present in that view.

Inserts a node into the backing child collection; active sort and filter descriptors determine its view position and visibility.

C#
public void Insert(int index, RadTreeNode item)
Parameters:indexint

The insertion index in the backing child collection.

itemRadTreeNode

The node to insert.

Removes a node from the backing child collection if it is present in the current view.

C#
public bool Remove(RadTreeNode item)
Parameters:itemRadTreeNode

The node to remove.

Returns:

bool

true if the current view changed; otherwise, false.

Removes the node at the specified index in the current view from the backing child collection.

C#
public void RemoveAt(int index)
Parameters:indexint

The zero-based index in the current view.

Applies pending view changes when the owner is attached and is not suspending updates.

C#
protected bool Update()
Returns:

bool

true if a pending update was processed; otherwise, false.

Rebuilds the current view from the owner's sort and filter descriptors.

C#
protected bool UpdateView()
Returns:

bool

true after the view has been rebuilt.