Example #1
0
 protected virtual void OnNodeCollapsed(CollapsedEventArgs e)
 {
     if (this.NodeCollapsed != null)
     {
         NodeCollapsed(this, e);
     }
 }
Example #2
0
 private void treeGridView_NodeCollapsed(object sender, CollapsedEventArgs e)
 {
     if (e.Node.Tag is CodeFolder || e.Node.Level == 0)
     {
         e.Node.ImageIndex = 1;
     }
 }
Example #3
0
        protected internal virtual bool CollapseNode(TreeGridNode node)
        {
            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;
            }
        }
        /// <summary>
        /// Collapses the node.
        /// </summary>
        /// <param name="node">The OutlookGridRow node.</param>
        /// <returns></returns>
        public bool CollapseNode(OutlookGridRow node)
        {
            if (!node.Collapsed)
            {
                CollapsingEventArgs exp = new CollapsingEventArgs(node);
                OnNodeCollapsing(exp);

                if (!exp.Cancel)
                {
                    node.SetNodeCollapse(true);

                    CollapsedEventArgs exped = new CollapsedEventArgs(node);
                    OnNodeCollapsed(exped);
                }

                return !exp.Cancel;
            }
            else
            {
                // row isn't expanded, so we didn't do anything.
                return false;
            }
        }