private void addHMergedCell(int row, string leftColumn, string rightColumn, string text, StringAlignment alignment, StringAlignment lineAlignment, bool readOnly, Font font) { int leftIndex = gridElementi.Columns[leftColumn].Index; int rightIndex = gridElementi.Columns[rightColumn].Index; for (int i = leftIndex; i <= rightIndex; i++) { HMergedCell cell = new HMergedCell(leftIndex, rightIndex, alignment, lineAlignment); gridElementi.Rows[row].Cells[i] = cell; cell.ReadOnly = readOnly; if (font != null) { cell.Style.Font = font; } } gridElementi.Rows[row].Cells[leftIndex].Value = text; }
private void addHMergedCell(int row, string leftColumn, string rightColumn, string text, StringAlignment alignment, StringAlignment lineAlignment, bool readOnly, Font font) { int leftIndex = gridElementi.Columns[leftColumn].Index; int rightIndex = gridElementi.Columns[rightColumn].Index; for (int i = leftIndex; i <= rightIndex; i++) { HMergedCell cell = new HMergedCell(leftIndex, rightIndex, alignment, lineAlignment); gridElementi.Rows[row].Cells[i] = cell; cell.ReadOnly = readOnly; if (font != null) cell.Style.Font = font; } gridElementi.Rows[row].Cells[leftIndex].Value = text; }