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