menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeNodes - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TreeNodes

    A collection of TreeNode elements. The collection maintains both a list of nodes and a binary tree collection with height of nodes and number of rows. When adding, removing or changing nodes this collection ensures the binary tree collection is kept in sync with changes.

    The TreeNodes collection is accessed through the ChildNodes property of a TreeNode. TreeNode gets the counters from this collection when determining the total height of nested nodes and also the number of visible nested nodes.

    Inheritance
    System.Object
    TreeNodes
    Implements
    System.Collections.Generic.IList<TreeNode>
    System.Collections.Generic.ICollection<TreeNode>
    System.Collections.Generic.IEnumerable<TreeNode>
    System.Collections.IEnumerable
    ITreeTableCounterSource
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Controls.VirtualTreeView
    Assembly: Syncfusion.GridCommon.WPF.dll
    Syntax
    public class TreeNodes : IList<TreeNode>, ICollection<TreeNode>, IEnumerable<TreeNode>, IEnumerable, ITreeTableCounterSource, IDisposable

    Constructors

    TreeNodes(TreeNode)

    Initializes a new instance of the TreeNodes class.

    Declaration
    public TreeNodes(TreeNode parentNode)
    Parameters
    Type Name Description
    TreeNode parentNode

    The parent node.

    Properties

    Count

    Gets the number of nodes contained in the collection (not nested nodes).

    Declaration
    public int Count { get; }
    Property Value
    Type
    System.Int32

    IsFixedSize

    Gets a value indicating whether this instance is fixed size.

    Declaration
    public bool IsFixedSize { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is fixed size; otherwise, false.

    IsInitializing

    Gets a value indicating whether this instance is initializing.

    Declaration
    public bool IsInitializing { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is initializing; otherwise, false.

    IsReadOnly

    Gets a value indicating whether the collection is read-only.

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type
    System.Boolean

    IsSynchronized

    Gets a value indicating whether this instance is synchronized.

    Declaration
    public bool IsSynchronized { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is synchronized; otherwise, false.

    Item[Int32]

    Gets or sets the TreeNode at the specified index.

    Declaration
    public TreeNode this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type
    TreeNode

    ParentNode

    Gets the parent node.

    Declaration
    public TreeNode ParentNode { get; }
    Property Value
    Type Description
    TreeNode

    The parent node.

    TreeModel

    Gets the tree model.

    Declaration
    public TreeModel TreeModel { get; }
    Property Value
    Type Description
    TreeModel

    The tree model.

    Methods

    Add(TreeNode)

    Adds a tree node.

    Declaration
    public void Add(TreeNode treeNode)
    Parameters
    Type Name Description
    TreeNode treeNode

    The tree node.

    Clear()

    Removes all items from the collection.

    Declaration
    public void Clear()

    Contains(TreeNode)

    Determines whether the tree node is a direct child node (not grand child) of this collection.

    Declaration
    public bool Contains(TreeNode value)
    Parameters
    Type Name Description
    TreeNode value

    The value.

    Returns
    Type Description
    System.Boolean

    true if it is a child node; otherwise, false.

    CopyTo(TreeNode[], Int32)

    Copies to another array.

    Declaration
    public void CopyTo(TreeNode[] array, int index)
    Parameters
    Type Name Description
    TreeNode[] array

    The array.

    System.Int32 index

    The index.

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()

    GetNext(TreeNode)

    Gets the next tree node.

    Declaration
    public TreeNode GetNext(TreeNode treeNode)
    Parameters
    Type Name Description
    TreeNode treeNode

    The tree node.

    Returns
    Type
    TreeNode

    GetPrevious(TreeNode)

    Gets the previous tree node.

    Declaration
    public TreeNode GetPrevious(TreeNode treeNode)
    Parameters
    Type Name Description
    TreeNode treeNode

    The tree node.

    Returns
    Type
    TreeNode

    IndexOf(TreeNode)

    Returns the index of the node in this collection.

    Declaration
    public int IndexOf(TreeNode value)
    Parameters
    Type Name Description
    TreeNode value

    The value.

    Returns
    Type
    System.Int32

    Insert(Int32, TreeNode)

    Inserts the node at the specified index.

    Declaration
    public void Insert(int index, TreeNode treeNode)
    Parameters
    Type Name Description
    System.Int32 index

    The index.

    TreeNode treeNode

    The tree node.

    InvalidateCounterBottomUp()

    Marks all counters dirty in this object and parent nodes.

    Declaration
    public void InvalidateCounterBottomUp()

    InvalidateCounterTopDown(Boolean)

    Marks all counters dirty in this object and child nodes.

    Declaration
    public void InvalidateCounterTopDown(bool notifyCounterSource)
    Parameters
    Type Name Description
    System.Boolean notifyCounterSource

    if set to true notify counter source.

    Remove(TreeNode)

    Removes the specified tree node.

    Declaration
    public bool Remove(TreeNode treeNode)
    Parameters
    Type Name Description
    TreeNode treeNode

    The tree node.

    Returns
    Type
    System.Boolean

    RemoveAt(Int32)

    Removes the child node at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the item to remove.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is not a valid index in the collection.

    Explicit Interface Implementations

    ITreeTableCounterSource.GetCounter()

    Declaration
    ITreeTableCounter ITreeTableCounterSource.GetCounter()
    Returns
    Type
    ITreeTableCounter

    IEnumerable<TreeNode>.GetEnumerator()

    Declaration
    IEnumerator<TreeNode> IEnumerable<TreeNode>.GetEnumerator()
    Returns
    Type
    System.Collections.Generic.IEnumerator<TreeNode>

    IEnumerable.GetEnumerator()

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type
    System.Collections.IEnumerator

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    ITreeTableCounterSource
    System.IDisposable

    Extension Methods

    PivotExtension.GroupByMany<TElement>(IEnumerable<TElement>, Int32, Func<TElement, Object>[])
    PivotExtension.GroupByMany<TElement>(IEnumerable<TElement>, IEnumerable<Func<TElement, Object>>)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    ChartExtensionUtils.DistinctBy<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved