//Constructor public Spreadsheet(int rows, int columns) { numRows = rows; numColumns = columns; sheet = new Cell2D[rows, columns]; //Fill up the sheet for (int rowCount = 0; rowCount < numRows; rowCount++) { for (int columnCount = 0; columnCount < numColumns; columnCount++) { sheet[rowCount, columnCount] = new Cell2D(rowCount, columnCount); sheet[rowCount, columnCount].PropertyChanged += CellChanged; } } }
public spreadsheet(int column, int row) { Cellset = new Cell2D[column, row]; int i = 0; int j = 0; while (i < column) { while (j < row) { Cellset[i, j] = new Cell2D(i, j); j++; } i++; } ColumnCount = column; RowCount = row; }