protected virtual void OnNodeCollapsed(CollapsedEventArgs e) { if (this.NodeCollapsed != null) { NodeCollapsed(this, e); } }
internal protected virtual bool CollapseNode(TreeGridNode node) { if (node == null) { return(false); ///applied validation by sunil dabhi (21-May-2011) } if (node.IsExpanded) { CollapsingEventArgs exp = new CollapsingEventArgs(node); this.OnNodeCollapsing(exp); if (!exp.Cancel) { this.LockVerticalScrollBarUpdate(true); this.SuspendLayout(); _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 _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); } }