Class TreeNodeCollection
Represents a class that maintains the common functionalities of collection of TreeNode.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.TreeGrid
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class TreeNodeCollection : Object, 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 System.Collections.Generic.ICollection<>.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection<> is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the System.Collections.Generic.ICollection<> is read only; otherwise false. |
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. |
MaxLevel
Get the maximum level of the tree.
Declaration
public int MaxLevel { get; }
Property Value
Type |
---|
System.Int32 |
ResetCache
Gets or sets a boolean value indicating whether to reset the cache.
Declaration
public bool ResetCache { get; set; }
Property Value
Type |
---|
System.Boolean |
RootNodes
Gets or sets the RootNodes.
Declaration
public TreeNodes RootNodes { get; set; }
Property Value
Type |
---|
TreeNodes |
Methods
Add(TreeNode)
Adds an item to the System.Collections.Generic.ICollection<>.
Declaration
public void Add(TreeNode item)
Parameters
Type | Name | Description |
---|---|---|
TreeNode | item | The corresponding item. |
Clear()
Removes all items from the System.Collections.Generic.ICollection<>.
Declaration
public void Clear()
Contains(TreeNode)
Determines whether the System.Collections.Generic.ICollection<> 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.ICollection; otherwise false. |
CopyTo(TreeNode[], Int32)
Copies the elements of System.Collections.Generic.ICollection<> 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 TreeNodeCollection class.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes all the resources used by the TreeNodeCollection 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. |
GetCount()
Gets the number of child nodes (+1 for the current node).
Declaration
public int GetCount()
Returns
Type | Description |
---|---|
System.Int32 | 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 |
---|---|
System.Collections.Generic.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 |
---|---|---|
System.Object | data | The specified data. |
Returns
Type | Description |
---|---|
System.Int32 | The index |
GetMaxLevel()
Gets the maximum level of node in the tree node collection.
Declaration
public int GetMaxLevel()
Returns
Type | Description |
---|---|
System.Int32 | 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 |
---|---|---|
System.Object | data | data. |
Returns
Type | Description |
---|---|
TreeNode | TreeNode. |
IndexOf(TreeNode)
Determines the index of a specific treenode in the System.Collections.Generic.IList<>.
Declaration
public int IndexOf(TreeNode treeNode)
Parameters
Type | Name | Description |
---|---|---|
TreeNode | treeNode | The corresponding treenode. |
Returns
Type | Description |
---|---|
System.Int32 | The index of item if found in the list;otherwise, -1 |
Insert(Int32, TreeNode)
Inserts an item to System.Collections.Generic.IList<> at the specified index.
Declaration
public void Insert(int index, TreeNode item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | 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 |
---|---|
System.Boolean | 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 |
---|---|
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. |
SetDirty()
Sets the dirty. When this is set to true, the YAmountCache will be re-computed for the whole node.
Declaration
public void SetDirty()