Helpers in UWP TreeGrid (SfTreeGrid)
10 May 20211 minute to read
SfTreeGrid has TreeGridIndexResolver static class present in the Syncfusion.UI.Xaml.TreeGrid namespace has some extension methods to resolve from row or column index to node or visible column index and vice-versa.
For example, you can get a node from its row index using the GetNodeAtRowIndex method.
|ResolveToNodeIndex(int rowindex)||Resolves the node index from the row index. When the row index does not find any record, it returns -1. The NodeIndex denotes the index of node in SfTreeGrid.View.Nodes.|
|ResolveToRowIndex(int nodeIndex)||Resolves the row index from the node index associated with SfTreeGrid.View.Nodes. When the node index is lesser than 0, it returns -1.|
|ResolveToRowIndex(object data)||Resolves the row index from the data associated with SfTreeGrid.View.Nodes. When the given node is not available in the collection, it returns -1.|
|ResolveToRowIndex(TreeNode node)||Resolves the row index from the node associated with SfTreeGrid.View.Nodes. When the given node is not available in the collection, it returns -1.|
|ResolveToGridVisibleColumnIndex(int columnIndex)||Resolves the TreeGridColumn index from the visible column index. It excludes row header and indent column.|
|ResolveToScrollColumnIndex(int gridColumnIndex)||Resolves the column index from the grid column index associated with SfTreeGrid.Columns. It also includes indent column and row header.|
|ResolveToStartColumnIndex()||Returns the start column index of the VisibleColumn.|
|GetHeaderIndex()||Returns the header row index.|
|GetNodeAtRowIndex(int rowIndex)||Gets the tree node based on the row index.|
This method is associated with relinquishes memory and clears all references associated with treegrid. When you call this method, it releases all references for treegrid. So, the memory occupied using treegrid is reclaimed. You have to call the SfTreeGrid.Dispose method to release the memory.