Esempio n. 1
0
        private void CreateCells()
        {
            foreach (Column column in columns)
            {
                DataCellX cell = new DataCellX
                {
                    Size = column.HeaderCell.CalculatePreferredSize()
                };

                AddCellToSize(cell);
                cells.Add(cell);
            }
        }
Esempio n. 2
0
        private void CreateCells()
        {
            cells.Clear();

            for (int i = 0; i < dataRow.CellCount; i++)
            {
                DataCellX cell = new DataCellX
                {
                    Size = dataRow[i].CalculatePreferredSize()
                };

                AddCellToSize(cell);

                cells.Add(cell);
            }
        }
Esempio n. 3
0
        private void AddCellToSize(DataCellX cell)
        {
            int width = cells.Count == 0 && hasBorder
                ? 1
                : Size.Width;

            width += cell.Size.Width;

            if (hasBorder)
            {
                width++;
            }

            int height = Size.Height < cell.Size.Height
                ? cell.Size.Height
                : Size.Height;

            Size = new Size(width, height);
        }