# Understanding the Axis Model

This topic explains about the Axis model used in Spread for ASP.NET. Learn more in documentation.

## Content

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.

## Overview

Many of the axis-related settings are included in the following shortcut objects:

* Column, Columns
* Row, Rows
* AlternatingRow, AlternatingRows

These settings include:

* row height
* column width
* row visible
* column visible

To use the underlying axis model, use the methods of the axis model. These include the [SetSize](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.SetSize.html) method, for setting the row height or column width, and the [SetVisible](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.SetVisible.html) method for setting the row or column visible properties. There are other methods, too, such as [SetMergePolicy](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.SetMergePolicy.html), 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](/spreadnet/docs/latest/online-asp/overview/assembly-reference) for more information on the axis model in general and to the [DefaultSheetAxisModel](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.html) 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,

* Create a class derived from [DefaultSheetAxisModel](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.html) that takes a reference to the SheetView in its constructor and stores it in a field.
* Override the [GetSize](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.GetSize.html) method for the row index.
* Optionally, you can override the [GetResizable](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.GetResizable.html) method to prevent the user from trying to change the row heights manually, which will not work since [GetSize](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Model.DefaultSheetAxisModel.GetSize.html) is always returning the preferred height.

## Example

The following example code makes each row three times taller than the default height.

```csharp
public class MyRowAxisModel : FarPoint.Web.Spread.Model.DefaultSheetAxisModel
{
  public overrides int GetSize(int index)
  {
    if ( index % 2 == 1 )
      return 60;
    else
      return 20; }
}
```

```vbnet
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
```