protected virtual void OnNodeCollapsing(CollapsingEventArgs e) { if (NodeCollapsing != null) { NodeCollapsing(this, e); } }
internal protected virtual bool CollapseNode(TreeGridNode node) { if (node.IsExpanded) { CollapsingEventArgs exp = new CollapsingEventArgs(node); OnNodeCollapsing(exp); if (!exp.Cancel) { LockVerticalScrollBarUpdate(true); SuspendLayout(); _inExpandCollapse = true; node.IsExpanded = false; foreach (TreeGridNode childNode in node.Nodes) { UnSiteNode(childNode); } CollapsedEventArgs exped = new CollapsedEventArgs(node); OnNodeCollapsed(exped); //TODO: Convert this to a specific NodeCell property _inExpandCollapse = false; LockVerticalScrollBarUpdate(false); ResumeLayout(true); InvalidateCell(node.Cells[0]); } return(!exp.Cancel); } else { // row isn't expanded, so we didn't do anything. return(false); } }