public static void AddRow(GridForm grid) { ++grid.dataGridView.RowCount; OnGridMathCellsProvider.InitEmptyCells(grid); HeadersUpdater headersUpdater = new HeadersUpdater(grid, new UpdateRows()); headersUpdater.Update(); }
public static void InsertRow(GridForm grid) { int rowIndex = grid.dataGridView.CurrentCell.RowIndex; grid.dataGridView.Rows.Insert(rowIndex); OnGridMathCellsProvider.InitEmptyCells(grid); MathCellsShifter mathCellsShifter = new MathCellsShifter(new ShiftAfterRowInsert(), rowIndex, grid); mathCellsShifter.Shift(); HeadersUpdater headersUpdater = new HeadersUpdater(grid, new UpdateRows()); headersUpdater.Update(); }
private void InitialGridSetup() { MathCellsProvider.GetInstance.ResetMathCells(); ClearGrid(); ClearOutputBoxes(); const int initN = 10; const int initM = 10; dataGridView.RowCount = initN; dataGridView.ColumnCount = initM; HeadersUpdater headersUpdater = new HeadersUpdater(this, new UpdateRows(), new UpdateColumns()); headersUpdater.Update(); OnGridMathCellsProvider.InitEmptyCells(this); }
public static void InsertColumn(GridForm grid) { int colIndex = grid.dataGridView.CurrentCell.ColumnIndex; DataGridViewTextBoxColumn dummyCol = new DataGridViewTextBoxColumn { HeaderText = "dummyColText" }; grid.dataGridView.Columns.Insert(colIndex, dummyCol); OnGridMathCellsProvider.InitEmptyCells(grid); MathCellsShifter mathCellsShifter = new MathCellsShifter(new ShiftAfterColumnInsert(), colIndex, grid); mathCellsShifter.Shift(); HeadersUpdater headersUpdater = new HeadersUpdater(grid, new UpdateColumns()); headersUpdater.Update(); }