Saturday, October 11, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com



     
 »Spread for Windows Forms » Product Tour » Models » Axis

Previous Understanding the Axis Model Next

  Back to Top
 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. This includes many of the axis-related settings 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 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.

As an example of how you could use the axis model to improve performance of a spreadsheet, consider a spreadsheet with an 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.

This only requires creating a class derived from DefaultSheetAxisModel that takes a reference to the SheetView in its constructor and stores it in a field. Then override the GetSize method to call GetPreferredRowHeight (in the SheetView) for the row index. You can also override the GetResizable method to prevent the user from trying to change the row heights manually, which will not work since GetSize is always returning the preferred height.



    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
Learn about the new Roadshow now!

Tour Home
Overview
Appearance
User Interaction
Cell Types
Formulas
Managing Data
Data Binding
Import/Export
Printing
Keyboard Interaction
Shapes
Models
Spread Designer
 
Map

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.