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

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

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

                AddCellToSize(cell);

                cells.Add(cell);
            }
        }
Exemplo 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);
        }