private static void treeview_NodeExpanded(object sender, ExpandedEventArgs e) { try { if (e.Node.Nodes.Count == 0) return; if (e.Node.Nodes[0].Cells[0].Value.ToString() != BusinessConstants.DB4OBJECTS_DUMMY) return; e.Node.Nodes.RemoveAt(0); TreeGridView tree = e.Node.DataGridView as TreeGridView; Helper.DbInteraction.ExpandTreeNode(e.Node, ((tree.Parent)).Name == CONST_TRUE); } catch (Exception oEx) { LoggingHelper.ShowMessage(oEx); } }
protected virtual void OnNodeExpanded(ExpandedEventArgs e) { if (this.NodeExpanded != null) { NodeExpanded(this, e); } }
private void treeGridView_NodeExpanded(object sender, ExpandedEventArgs e) { if (e.Node.Tag is CodeFolder || e.Node.Level == 0) { e.Node.ImageIndex = 0; } }
protected internal virtual bool ExpandNode(TreeGridNode node) { if (!node.IsExpanded || this._virtualNodes) { ExpandingEventArgs exp = new ExpandingEventArgs(node); this.OnNodeExpanding(exp); if (!exp.Cancel) { this.LockVerticalScrollBarUpdate(true); this.SuspendLayout(); _inExpandCollapse = true; node.IsExpanded = true; //TODO Convert this to a InsertRange foreach (TreeGridNode childNode in node.Nodes) { Debug.Assert(childNode.RowIndex == -1, "Row is already in the grid."); this.SiteNode(childNode); //this.BaseRows.Insert(rowIndex + 1, childRow); //TODO : remove -- just a test. //childNode.Cells[0].Value = "child"; } ExpandedEventArgs exped = new ExpandedEventArgs(node); this.OnNodeExpanded(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 is already expanded, so we didn't do anything. return false; } }
/// <summary> /// Expands the node. /// </summary> /// <param name="node">The OutlookGridRow node.</param> /// <returns></returns> public bool ExpandNode(OutlookGridRow node) { if (node.Collapsed) { ExpandingEventArgs exp = new ExpandingEventArgs(node); OnNodeExpanding(exp); if (!exp.Cancel) { node.SetNodeCollapse(false); ExpandedEventArgs exped = new ExpandedEventArgs(node); OnNodeExpanded(exped); } return !exp.Cancel; } else { // row isn't expanded, so we didn't do anything. return false; } }