Spread ASP.NET 6.0 Product Documentation
Understanding the Selection Model
Send Feedback
Spread ASP.NET 6.0 Product Documentation > Developer's Guide > Using Sheet Models > Finding More Details on the Sheet Model > Understanding the Selection Model

Glossary Item Box

The selection model includes any of the settings related to ranges of selected cells. This may include methods such as counting the number of selected ranges, adding and removing selections, clearing selections and finding whether a cell is selected.

To use the underlying selection model, use the methods of the selection model. These include the SetSelection method, for setting cells as selected, and the AddSelection, ClearSelection and RemoveSelection methods for adding, clearing, and removing selected ranges from the sheet. Refer to the Assembly Reference for more information on the selection model in general and to the DefaultSheetSelectionModel methods in particular.

The default implementation of the selection model (DefaultSheetSelectionModel) handles the selection of cells and ranges in the sheet, and stores the actual cell and range coordinates for each selection. The selection model handles the selection data, including computing the range being selected based on the cell clicked (the anchor cell) and the cell under the mouse.

Some events cause the anchor cell in the selection model to get set (that is, left mouse button down on a cell) so the selection model has the active cell as a selection. If you enter edit mode then cancel it by pressing the Escape key (Esc), or if you use the keyboard to move the active cell around instead of the mouse, then the selection model may get cleared.

The selection model is saved to the view state only if it contains at least one selection.

Return to the overview of Finding More Details on the Sheet Models.

© 2002-2012 GrapeCity, Inc. All Rights Reserved.