Class TreeNodeCollection
Represents a class that maintains the common functionalities of collection of TreeNode.
Inherited Members
Namespace: Syncfusion.Maui.TreeGrid
Assembly: Syncfusion.Maui.TreeGrid.dll
Syntax
public class TreeNodeCollection : IList<TreeNode?>, ICollection<TreeNode?>, IEnumerable<TreeNode?>, IEnumerable, IDisposable
Constructors
TreeNodeCollection()
Initializes a new instance of TreeNodeCollection class.
Declaration
public TreeNodeCollection()
Properties
Count
Gets the number of elements contained in the ICollection<T>.
Declaration
public int Count { get; }
Property Value
| Type |
|---|
| int |
IsReadOnly
Gets a value indicating whether the ICollection<T> is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool | true if the ICollection<T> is read only; otherwise false. |
this[int]
Gets or sets the element at the specified index.
Declaration
public TreeNode? this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The specified index. |
Property Value
| Type | Description |
|---|---|
| TreeNode | The element at the specified index. |
MaxLevel
Get the maximum level of the tree.
Declaration
public int MaxLevel { get; }
Property Value
| Type |
|---|
| int |
ResetCache
Gets or sets a boolean value indicating whether to reset the cache.
Declaration
public bool ResetCache { get; set; }
Property Value
| Type |
|---|
| bool |
RootNodes
Gets or sets the RootNodes.
Declaration
public TreeNodes RootNodes { get; set; }
Property Value
| Type |
|---|
| TreeNodes |
Methods
Add(TreeNode?)
Adds an item to the ICollection<T>.
Declaration
public void Add(TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | item | The corresponding item. |
Clear()
Removes all items from the ICollection<T>.
Declaration
public void Clear()
Contains(TreeNode?)
Determines whether the ICollection<T> contains a specific value.
Declaration
public bool Contains(TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | item | The specified value. |
Returns
| Type | Description |
|---|---|
| bool | true if the item is found in the ICollection; otherwise false. |
CopyTo(TreeNode?[], int)
Copies the elements of ICollection<T> to an Array starting from particular array index.
Declaration
public void CopyTo(TreeNode?[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode[] | array | The Corresponding array. |
| int | arrayIndex | The corresponding array index. |
Dispose()
Disposes all the resources used by the TreeNodeCollection class.
Declaration
public void Dispose()
Dispose(bool)
Disposes all the resources used by the TreeNodeCollection class.
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isDisposing | Indicates whether the call is from Dispose method or from a finalizer. |
GetCount()
Gets the number of child nodes (+1 for the current node).
Declaration
public int GetCount()
Returns
| Type | Description |
|---|---|
| int | The number of child nodes (+1 for the current node). |
GetEnumerator()
Gets an enumerator that iterates thorugh the collection.
Declaration
public IEnumerator<TreeNode?> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<TreeNode> | An enumerator that iterates thorugh the collection. |
GetIndexFromData(object)
Gets the index of the specified data.
Declaration
public int GetIndexFromData(object data)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | The specified data. |
Returns
| Type | Description |
|---|---|
| int | The index |
GetMaxLevel()
Gets the maximum level of node in the tree node collection.
Declaration
public int GetMaxLevel()
Returns
| Type | Description |
|---|---|
| int | The maximum level of node in the tree node collection |
GetNode(object)
Gets the node which matches the given data.
Declaration
public TreeNode? GetNode(object data)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | data. |
Returns
| Type | Description |
|---|---|
| TreeNode | TreeNode. |
IndexOf(TreeNode?)
Determines the index of a specific treenode in the IList<T>.
Declaration
public int IndexOf(TreeNode? treeNode)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | treeNode | The corresponding treenode. |
Returns
| Type | Description |
|---|---|
| int | The index of item if found in the list;otherwise, -1 |
Insert(int, TreeNode?)
Inserts an item to IList<T> at the specified index.
Declaration
public void Insert(int index, TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The corresponding index. |
| TreeNode | item | The specified item. |
IsNodeInView(TreeNode)
Determines whether the TreeNode is in view or not.
Declaration
public bool IsNodeInView(TreeNode node)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | node | TreeNode. |
Returns
| Type | Description |
|---|---|
| bool | true if the node is in view; otherwise , false. |
Remove(TreeNode?)
Removes the first occurence of the specified item.
Declaration
public bool Remove(TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | item | The specified item. |
Returns
| Type | Description |
|---|---|
| bool | true if the item is succesfully removed; otherwise false. |
RemoveAt(int)
Removes the item from IList<T> at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The specified index. |
SetDirty()
Sets the dirty. When this is set to true, the YAmountCache will be re-computed for the whole node.
Declaration
public void SetDirty()