To understand how models work, think of the sheet (SheetView object) as a composite of the five underlying models:
- Axis - The Axis model handles everything to do with the columns and rows (for example, the column width, row height, and whether a row or column is visible).
- Data - The Data model handles everything to do with the data (for example, the value, the formula, and any optional notes or tags in a cell) and contains the data in the sheet.
- Selection - The Selection model handles any cell range selections that are made.
- Span - The Span model handles any spanned cells.
- Style - The Style model handles the appearance settings for the cells (for example, the background color, the font, and the cell type).
Sheet Model | Classes and Interface | Description |
---|---|---|
Axis model | Basis for how the sheet’s rows and columns are structured. For more information, see Understanding the Axis Model. | |
Data model | Basis for the data in the cells in the sheet. For more information, see Understanding the Data Model. | |
Selection model | Basis for the behavior of and interaction of selected cells in the sheet. For more information, see Understanding the Selection Model. | |
Span model | Basis for how cells in the sheet are spanned. For more information, see Understanding the Span Model. | |
Style model | Basis for the appearance of the cells in the sheet. For more information, see Understanding the Style Model. |
Everything you do to the model is automatically updated in the sheet and most of the aspects of the sheet that you can modify are updated in the model. This is also true for Cell, Row, and Column object settings. Most of the aspects changed with these objects automatically change the setting in the corresponding sheet model and vice versa; for example, if you add columns to the data model, then they are added to the sheet. This is true even for the parameters; for example, the row and column arguments in the GetValue and SetValue methods for the data model are the same indexes as that of the rows and columns in the sheet as long as the sheet is not sorted.
As shown in the figure in Using Sheet Models, the component is considered to have four quadrants. The data area of the spreadsheet is considered one sheet with its own set of models, and the row headers, column headers, and corner are considered as separate sheets, each with their own models.
Not everything in the Spread namespace is in the models. For example, there are aspects of the overall component, such as the sheet tabs, the sheet background color, and the grid lines, that are not in the models. But the relevant information about a given cell, both about the data in the cells and about the appearance of the cells, is in the models.