internal void ExpandNode(TreeNode node, int rowIndex, bool reExpand = false) { if (node == null) { return; } if (!reExpand) { CommitCurrentRow(); } //After committing, corresponding node's row index will be changes. so recalculating row index. rowIndex = this.treeGrid.ResolveToRowIndex(node); if (!reExpand) { if (node.IsExpanded) { return; } var expandingArgs = this.treeGrid.RaiseNodeExpanding(new NodeExpandingEventArgs() { Node = node }); if (expandingArgs.Cancel) { ChangeExpanderState(rowIndex, false); return; } else { // While expanding node programmatically, need to change expander cell's Expanded state. ChangeExpanderState(rowIndex, true); } } if (reExpand) { node.SetDirtyOnExpandOrCollapse(); UpdateExpander(node); } var itemsCount = View.ExpandNode(node, reExpand); if (!suspend && rowIndex != -1 && node.IsExpanded) { InsertRows(rowIndex, itemsCount); } if (!reExpand) { this.treeGrid.RaiseNodeExpanded(new NodeExpandedEventArgs() { Node = node }); } if (!suspend && treeGrid.isGridLoaded) { treeGrid.TreeGridPanel.UpdateScrollBars(); treeGrid.TreeGridColumnSizer.ChangeExpanderColumnWidth(); } }