Spread Windows Forms 10.0 Product Documentation > Developer's Guide > Understanding the Underlying Models > Understanding the Types of Sheet Models |
The Spread component models are illustrated conceptually in the following diagram:
As shown in the figure, the data area of the spreadsheet has its own set of models, and the row headers and column headers have models assigned to each of them. Finally, the sheet corner has its own set of models.
As the diagram illustrates, it can be useful to think of the sheet (SheetView object) as a composite of the five underlying models.
You can do many tasks without ever using the models by using the Spread Designer or properties of the shortcut objects (such as Cells, Columns, and Rows). Since sheet models are the basis for all the shortcut objects, using models is generally faster than using shortcut objects. For example, code using the shortcut object to set a value:
FpSpread1.Sheets(0).Cells(0,0).Value = "Test"
would be equivalent to using the underlying data model method:
FpSpread1.Sheets(0).DataModel.SetValue(FpSpread1.Sheets(0). GetModelRowFromViewRow(0), FpSpread1.Sheets(0). GetModelColumnFromViewColumn(0), "Test")
The sheet models correspond to the basis of all the objects and settings of a particular sheet. Each sheet has its own set of models. If you have multiple sheets in your Spread component, then each sheet has its own set of models.
There are many interfaces involved in the models. Each model class implements a number of interfaces, and each model has one "model" interface which must be implemented to make it a valid implementation for that particular model. All references to the model classes are through the interfaces, and no assumptions are made as to what interfaces are implemented on each model (except for the "model" interface which must be present). If the model class does not implement a particular interface, then that functionality is simply disabled in the sheet (that is, if IDataSourceSupport is not implement by SheetView.Models.Data, then the DataSource and DataMember properties are not functional). For complete lists of these interfaces, you can look up the overview for the default model classes in the Assembly Reference.