Spread for ASP.NET 10 Product Documentation > Developer's Guide > Using Sheet Models > Understanding the Models > Understanding the Axis Model |
The axis model includes the methods that manage row- and column-related settings of the spreadsheet, that is, how the rows and columns of cells are oriented on the sheet.
Many of the axis-related settings are included in the following shortcut objects:
These settings include:
To use the underlying axis model, use the methods of the axis model. These include the SetSize method, for setting the row height or column width, and the SetVisible method for setting the row or column visible properties. There are other methods, too, such as SetMergePolicy, which set specific properties of the row or column, in this case whether cells can be automatically merged when their content is identical. Refer to the Assembly Reference for more information on the axis model in general and to the DefaultSheetAxisModel methods in particular.
As an example of how you could use the axis model to improve performance of a spreadsheet, consider a spreadsheet with a very large number of rows. If you are resizing the rows based on the data, then you might want to create a custom axis model for SheetView.Models.RowAxis to return this value. To do so,
The following example code makes each row three times taller than the default height.
C# |
Copy Code
|
---|---|
public class MyRowAxisModel : FarPoint.Web.Spread.Model.DefaultSheetAxisModel { public overrides int GetSize(int index) { if ( index % 2 == 1 ) return 60; else return 20; } } |
VB |
Copy Code
|
---|---|
Public Class MyRowAxisModel Inherits FarPoint.Web.Spread.Model.DefaultSheetAxisModel Public Overrides Function GetSize(index As Integer) As Integer If index \ 2 = 1 Then Return 60 Else Return 20 End If End Function End Class |