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
Implements
Namespace: Syncfusion.Windows.Controls.VirtualTreeView
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class TreeNodes : Object, 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 |
|
IsInitializing
Gets a value indicating whether this instance is initializing.
Declaration
public bool IsInitializing { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
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 |
|
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 |
|
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 |
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 |
|
Explicit Interface Implementations
ITreeTableCounterSource.GetCounter()
Declaration
ITreeTableCounter ITreeTableCounterSource.GetCounter()
Returns
Type |
---|
ITreeTableCounter |