Example #1
0
        void cells_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
        {
            // Exit if there already is a tree cell for this row
            if (_treeCell != null)
            {
                return;
            }

            if (e.Action == System.ComponentModel.CollectionChangeAction.Add || e.Action == System.ComponentModel.CollectionChangeAction.Refresh)
            {
                TreeGridCell treeCell = null;

                if (e.Element == null)
                {
                    foreach (DataGridViewCell cell in base.Cells)
                    {
                        if (cell.GetType().IsAssignableFrom(typeof(TreeGridCell)) && cell.RowIndex > -1)
                        {
                            treeCell = (TreeGridCell)cell;
                            break;
                        }
                    }
                }
                else
                {
                    treeCell = e.Element as TreeGridCell;
                }

                if (treeCell != null)
                {
                    _treeCell = treeCell;
                }
            }
        }
Example #2
0
        public override object Clone()
        {
            TreeGridCell c = (TreeGridCell)base.Clone();

            c.glyphWidth            = this.glyphWidth;
            c.calculatedLeftPadding = this.calculatedLeftPadding;

            return(c);
        }
Example #3
0
        void cells_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
        {
            // Exit if there already is a tree cell for this row
            if (_treeCell != null) return;

            if (e.Action == System.ComponentModel.CollectionChangeAction.Add || e.Action == System.ComponentModel.CollectionChangeAction.Refresh)
            {
                TreeGridCell treeCell = null;

                if (e.Element == null)
                {
                    foreach (DataGridViewCell cell in base.Cells)
                    {
                        if (cell.GetType().IsAssignableFrom(typeof(TreeGridCell)) && cell.RowIndex > -1)
                        {
                            treeCell = (TreeGridCell) cell;
                            break;
                        }

                    }
                }
                else
                {
                    treeCell = e.Element as TreeGridCell;
                }

                if (treeCell != null)
                  _treeCell = treeCell;
            }
        }