Class TreeTable
A tree table.
Implements
Namespace: Syncfusion.UI.Xaml.Grids.Collections
Assembly: Syncfusion.GridCommon.WinUI.dll
Syntax
public class TreeTable : Disposable, ITreeTable, IList, ICollection, IEnumerable, IDisposable
Constructors
TreeTable(Boolean)
Initializes a new TreeTable.
Declaration
public TreeTable(bool sorted)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | sorted |
Properties
Comparer
Gets / sets the comparer used by sorted trees.
Declaration
public IComparer Comparer { get; set; }
Property Value
Type |
---|
System.Collections.IComparer |
Count
Returns the number of leaves.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
IsFixedSize
Indicates whether the nodes can be added or removed.
Declaration
public bool IsFixedSize { get; }
Property Value
Type |
---|
System.Boolean |
IsInitializing
Indicates whether BeginInit was called.
Declaration
public bool IsInitializing { get; }
Property Value
Type |
---|
System.Boolean |
IsReadOnly
Indicates whether the tree is Read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type |
---|
System.Boolean |
IsSynchronized
Not supported.
Declaration
public bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Item[Int32]
Gets / sets an item at the specified index.
Declaration
public ITreeTableNode this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
ITreeTableNode |
lastIndexLeaf
Gets or sets the last index leaf.
Declaration
public ITreeTableEntry lastIndexLeaf { get; set; }
Property Value
Type | Description |
---|---|
ITreeTableEntry | The last index leaf. |
Root
Gets / sets the root node.
Declaration
public ITreeTableNode Root { get; set; }
Property Value
Type |
---|
ITreeTableNode |
Sorted
Indicates whether tree is sorted.
Declaration
public bool Sorted { get; }
Property Value
Type |
---|
System.Boolean |
SyncRoot
Not implemented.
Declaration
public object SyncRoot { get; }
Property Value
Type |
---|
System.Object |
Tag
Gets / sets the tag that can be associated with this object.
Declaration
public object Tag { get; set; }
Property Value
Type |
---|
System.Object |
Methods
Add(ITreeTableNode)
Appends a node.
Declaration
public int Add(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to append. |
Returns
Type |
---|
System.Int32 |
AddIfNotExists(Object, ITreeTableEntry)
Adds a node in a sorted tree only if no node with the same value has not been added yet.
Declaration
public ITreeTableEntry AddIfNotExists(object key, ITreeTableEntry value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | |
ITreeTableEntry | value | Node value to add. |
Returns
Type |
---|
ITreeTableEntry |
AddSorted(ITreeTableNode)
Adds a node into a sorted tree.
Declaration
public int AddSorted(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to add. |
Returns
Type |
---|
System.Int32 |
BeginInit()
Optimizes insertion of many elements when tree is initialized for the first time.
Declaration
public virtual void BeginInit()
Clear()
Clears all nodes in the tree.
Declaration
public void Clear()
Contains(ITreeTableNode)
Indicates whether the node belongs to this tree.
Declaration
public bool Contains(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to search for. |
Returns
Type | Description |
---|---|
System.Boolean | True if node belongs to this tree; false otherwise. |
CopyTo(ITreeTableNode[], Int32)
Copies the elements from this collection into an array.
Declaration
public void CopyTo(ITreeTableNode[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode[] | array | The destination array. |
System.Int32 | index | The starting index in the destination array. |
Dispose(Boolean)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Overrides
Remarks
See the documentation for the System.ComponentModel class and its Dispose member.
EndInit()
Ends optimization of insertion of elements when tree is initialized for the first time.
Declaration
public virtual void EndInit()
FindHighestSmallerOrEqualKey(Object)
Finds the node in a sorted tree is just one entry ahead of the node with the specified key. It searches for the largest possible key that is smaller than the specified key.
Declaration
public ITreeTableEntry FindHighestSmallerOrEqualKey(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key to search. |
Returns
Type | Description |
---|---|
ITreeTableEntry | The node; NULL if not found. |
FindKey(Object)
Finds a node in a sorted tree that matches the specified key.
Declaration
public ITreeTableEntry FindKey(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key to search. |
Returns
Type | Description |
---|---|
ITreeTableEntry | The node; NULL if not found. |
GetCount()
Returns the number of leaves.
Declaration
public int GetCount()
Returns
Type |
---|
System.Int32 |
GetEnumerator()
Returns a TreeTableEnumerator.
Declaration
public TreeTableEnumerator GetEnumerator()
Returns
Type |
---|
TreeTableEnumerator |
GetNextEntry(ITreeTableEntry)
Optimized access to a subsequent entry.
Declaration
public ITreeTableEntry GetNextEntry(ITreeTableEntry current)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableEntry | current |
Returns
Type |
---|
ITreeTableEntry |
GetPreviousEntry(ITreeTableEntry)
Optimized access to the previous entry.
Declaration
public ITreeTableEntry GetPreviousEntry(ITreeTableEntry current)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableEntry | current |
Returns
Type |
---|
ITreeTableEntry |
IndexOf(ITreeTableNode)
Returns the position of a node.
Declaration
public int IndexOf(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to look for. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the node if found. |
IndexOfKey(Object)
Finds a node in a sorted tree.
Declaration
public int IndexOfKey(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key |
Returns
Type |
---|
System.Int32 |
Insert(Int32, ITreeTableNode)
Inserts a node at the specified index.
Declaration
public void Insert(int index, ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index value where the node is to be inserted. |
ITreeTableNode | value | Value of the node to insert. |
Remove(ITreeTableNode)
Removes the specified node.
Declaration
public bool Remove(ITreeTableNode value)
Parameters
Type | Name | Description |
---|---|---|
ITreeTableNode | value | Node value to look for and remove. |
Returns
Type |
---|
System.Boolean |
RemoveAt(Int32)
Removes a node at the specified position.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
ResetCache()
Resets the cache.
Declaration
public void ResetCache()