Class TreeNodes
Represents a class that provides the implementation of TreeNodes in SfTreeGrid.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.TreeGrid
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class TreeNodes : Object, IList<TreeNode>, ICollection<TreeNode>, IEnumerable<TreeNode>, IEnumerable, IDisposable
Constructors
TreeNodes()
Initializes a new instance of TreeNodes class.
Declaration
public TreeNodes()
Properties
Count
Gets the number of elements contained in the System.Collections.Generic.IList<>.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.IList<> is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Gets or sets the element at the specified index.
Declaration
public TreeNode this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The specified index. |
Property Value
Type | Description |
---|---|
TreeNode | The element at the specified index. |
Methods
Add(TreeNode)
Adds an item to the System.Collections.Generic.IList<>.
Declaration
public void Add(TreeNode item)
Parameters
Type | Name | Description |
---|---|---|
TreeNode | item | The corresponding item. |
Clear()
Removes all items from the System.Collections.Generic.IList<>.
Declaration
public void Clear()
Contains(TreeNode)
Determines whether the System.Collections.Generic.IList<> contains a specific value.
Declaration
public bool Contains(TreeNode item)
Parameters
Type | Name | Description |
---|---|---|
TreeNode | item | The specified value. |
Returns
Type | Description |
---|---|
System.Boolean | true if the item is found in the System.Collections.Generic.IList<>; otherwise false. |
CopyTo(TreeNode[], Int32)
Copies the elements of System.Collections.Generic.IList<> to an System.Array starting from particular array index.
Declaration
public void CopyTo(TreeNode[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
TreeNode[] | array | The Corresponding array. |
System.Int32 | arrayIndex | The corresponding array index. |
Dispose()
Disposes all the resources used by the TreeNodes class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the TreeNodes class.
Declaration
protected virtual void Dispose(bool isDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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 |
---|---|
System.Collections.Generic.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 |
---|---|---|
System.Object | data | data. |
Returns
Type | Description |
---|---|
TreeNode | the TreeNode. |
IndexOf(TreeNode)
Determines the index of a specific item in the System.Collections.Generic.IList<>.
Declaration
public int IndexOf(TreeNode item)
Parameters
Type | Name | Description |
---|---|---|
TreeNode | item | The corresponding item. |
Returns
Type | Description |
---|---|
System.Int32 | The index of item if found in the list;otherwise, -1 |
IndexOfNode(Object)
Determines the index of node of the specific item in the System.Collections.Generic.IList<>.
Declaration
public int IndexOfNode(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The corresponding item. |
Returns
Type | Description |
---|---|
System.Int32 | The index of node of the item if found in the list;otherwise, -1 |
Insert(Int32, TreeNode)
Insert the item in nodeList only.
Declaration
public void Insert(int index, TreeNode item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | index. |
TreeNode | item | item. |
Insert(Int32, TreeNode, Int32)
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 |
---|---|---|
System.Int32 | sourceIndex | sourceIndex. |
TreeNode | item | item. |
System.Int32 | nodeIndex | nodeIndex. |
MoveTo(Int32, Int32)
Moves a item at the source index to the specified destination index.
Declaration
public void MoveTo(int sourceIndex, int destinationIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sourceIndex | The source index from where item to be removed. |
System.Int32 | 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 |
---|---|
System.Boolean | true if the item is succesfully removed; otherwise false. |
RemoveAt(Int32)
Removes the item from System.Collections.Generic.IList<> at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The specified index. |
RemoveRange(Int32, Int32)
Removes the range of items from the System.Collections.Generic.IList<> starting from the specified index.
Declaration
public void RemoveRange(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The specified Index. |
System.Int32 | count | The count of items to be removed. |