Beispiel #1
0
        public int AddChildCellRange(IEnumerable <DataGridViewGroupCell> cells)
        {
            bool needRedraw = false;

            if (ChildCells == null)
            {
                //需要画一个加号
                ChildCells = new List <DataGridViewGroupCell>();
                needRedraw = true;
            }

            foreach (DataGridViewGroupCell cell in cells)
            {
                if (!ChildCells.Contains(cell))
                {
                    ChildCells.Add(cell);
                    cell.GroupLevel = GroupLevel + 1;
                    cell.ParentCell = this;
                }
            }

            if (needRedraw)
            {
                DataGridView.InvalidateCell(this);
            }
            return(ChildCells.Count);
        }
Beispiel #2
0
 private void UpdateChildCells(IEnumerable <Token> tokens)
 {
     ChildCells.Clear();
     foreach (var token in tokens)
     {
         if (token is CellNameToken cellToken)
         {
             ChildCells.Add(cellToken.Value);
         }
     }
 }