Class TreeNodes
Represents a class that provides the implementation of TreeNodes in SfTreeGrid.
Inherited Members
Namespace: Syncfusion.Maui.TreeGrid
Assembly: Syncfusion.Maui.TreeGrid.dll
Syntax
public class TreeNodes : IList<TreeNode?>, ICollection<TreeNode?>, IEnumerable<TreeNode?>, IEnumerable, IDisposable
Constructors
TreeNodes()
Initializes a new instance of TreeNodes class.
Declaration
public TreeNodes()
Fields
nodeList
Declaration
protected List<TreeNode?> nodeList
Field Value
| Type |
|---|
| List<TreeNode> |
sourceList
Declaration
protected List<object> sourceList
Field Value
| Type |
|---|
| List<object> |
Properties
Count
Gets the number of elements contained in the IList<T>.
Declaration
public int Count { get; }
Property Value
| Type |
|---|
| int |
IsReadOnly
Gets a value indicating whether the IList<T> is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type |
|---|
| bool |
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. |
Methods
Add(TreeNode?)
Adds an item to the IList<T>.
Declaration
public void Add(TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | item | The corresponding item. |
Clear()
Removes all items from the IList<T>.
Declaration
public void Clear()
Contains(TreeNode?)
Determines whether the IList<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 IList<T>; otherwise false. |
CopyTo(TreeNode?[], int)
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 Syncfusion.UI.Xaml.TreeGrid.TreeNodes class.
Declaration
public void Dispose()
Dispose(bool)
Disposes all the resources used by the Syncfusion.UI.Xaml.TreeGrid.TreeNodes 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. |
GetEnumerator()
Gets an enumerator that iterates thorugh the collection.
Declaration
public virtual IEnumerator<TreeNode> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<TreeNode> | An enumerator that iterates thorugh the collection. |
GetNode(object)
Get the node from data.
Declaration
public TreeNode? GetNode(object data)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | data. |
Returns
| Type | Description |
|---|---|
| TreeNode | the TreeNode. |
IndexOf(TreeNode?)
Determines the index of a specific item in the IList<T>.
Declaration
public int IndexOf(TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | item | The corresponding item. |
Returns
| Type | Description |
|---|---|
| int | The index of item if found in the list;otherwise, -1 |
IndexOfNode(object)
Determines the index of node of the specific item in the IList<T>.
Declaration
public int IndexOfNode(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item | The corresponding item. |
Returns
| Type | Description |
|---|---|
| int | The index of node of the item if found in the list;otherwise, -1 |
Insert(int, TreeNode?)
Insert the item in nodeList only.
Declaration
public void Insert(int index, TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | index. |
| TreeNode | item | item. |
Insert(int, TreeNode, int)
Insert the item to sourceList and nodeList based on sourceIndex and nodeIndex respectively.
Declaration
public void Insert(int sourceIndex, TreeNode item, int nodeIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | sourceIndex | sourceIndex. |
| TreeNode | item | item. |
| int | nodeIndex | nodeIndex. |
MoveTo(int, int)
Moves a item at the source index to the specified destination index.
Declaration
public void MoveTo(int sourceIndex, int destinationIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | sourceIndex | The source index from where item to be removed. |
| int | destinationIndex | The destination index from where item to be added. |
Remove(TreeNode?)
Removes the first occurence of the specified item.
Declaration
public bool Remove(TreeNode? item)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeNode | item | The TreeNode. |
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. |
RemoveRange(int, int)
Removes the range of items from the IList<T> starting from the specified index.
Declaration
public void RemoveRange(int index, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The specified Index. |
| int | count | The count of items to be removed. |