Exemplo n.º 1
0
 private void cells_CollectionChanged(object sender, CollectionChangeEventArgs e)
 {
     if ((this._treeCell == null) && ((e.Action == CollectionChangeAction.Add) || (e.Action == CollectionChangeAction.Refresh)))
     {
         TreeGridCell element = null;
         if (e.Element == null)
         {
             foreach (DataGridViewCell cell2 in base.Cells)
             {
                 if (cell2.GetType().IsAssignableFrom(typeof(TreeGridCell)))
                 {
                     element = (TreeGridCell)cell2;
                     break;
                 }
             }
         }
         else
         {
             element = e.Element as TreeGridCell;
         }
         if (element != null)
         {
             this._treeCell = element;
         }
     }
 }
Exemplo n.º 2
0
        protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
        {
            int left   = e.CellBounds.Left;
            int top    = e.CellBounds.Top;
            int width  = e.CellBounds.Width;
            int height = e.CellBounds.Height;

            e.Handled = true;
            e.PaintBackground(e.CellBounds, true);
            if (this._drawContent)
            {
                e.PaintContent(e.CellBounds);
                Brush brush = new SolidBrush(base.GridColor);
                Pen   pen   = new Pen(brush);
                if (!((e.RowIndex != 0) || base.ColumnHeadersVisible))
                {
                    e.Graphics.DrawLine(pen, left, top, left + width, top);
                }
                if (e.RowIndex > -1)
                {
                    if (e.ColumnIndex == this._treedGridColumnsIndex)
                    {
                        TreeGridCell cell = this.Rows[e.RowIndex].Cells[e.ColumnIndex] as TreeGridCell;
                        left = cell.Style.Padding.Left;
                    }
                    e.Graphics.DrawLine(pen, left, (top + height) - 1, left + width, (top + height) - 1);
                }
            }
        }
Exemplo n.º 3
0
        public override object Clone()
        {
            TreeGridCell cell = (TreeGridCell)base.Clone();

            cell.GlyphWidth            = this.GlyphWidth;
            cell.CalculatedLeftPadding = this.CalculatedLeftPadding;
            return(cell);
        }
Exemplo n.º 4
0
 protected internal virtual void UnSited()
 {
     foreach (DataGridViewCell cell2 in this.Cells)
     {
         TreeGridCell cell = cell2 as TreeGridCell;
         if (cell != null)
         {
             cell.UnSited();
         }
     }
     this._isSited = false;
 }
Exemplo n.º 5
0
 protected internal virtual void Sited()
 {
     this._isSited          = true;
     this.childCellsCreated = true;
     foreach (DataGridViewCell cell2 in this.Cells)
     {
         TreeGridCell cell = cell2 as TreeGridCell;
         if (cell != null)
         {
             cell.Sited();
         }
     }
 }