The span model includes the objects needed to handle cell spans and automatic merging of cells. Refer to the Cell class, ColumnSpan and RowSpan properties.
To use the underlying span model, use the Add, Clear, and Remove methods of the span model. Refer to the DefaultSheetSpanModel class for more information on the span model in general and the methods in particular.
The default implementation of the span model (DefaultSheetSpanModel) uses an array to stored the cell spans. If there is modest number of spans in the sheet (for example, a thousand or less) then the default implementation works fine. If there is a very large number of spans in the sheet (for example, a hundred thousand or more) then the default implementation slows dramatically. In scenarios where you have a very large number of spans that repeat on a regular interval, you should consider writing a custom span model. By writing a custom span model, you can significantly increase the speed and decrease the memory usage.
For more details, refer to the BaseSheetSpanModel class, the DefaultSheetSpanModel class, and the ISheetSpanModel interface.
Return to the overview of Finding More Details on the Sheet Models.