Friday, July 04, 2008
HOME
.NET Product Center
SPREAD FOR .NET BUNDLE
SPREAD FOR WINDOWS FORMS
SPREAD FOR WEB FORMS
INPUT PRO FOR WIN FORMS
SUBSCRIPTIONS
SOA Center
SPREAD FOR BIZTALK SERVER
SPREAD FOR SHAREPOINT SERVER
COM Product Center
DEVELOPER TOOLBOX
DATABASE PACK
SPREAD
TAB PRO
INPUT PRO
LIST PRO
CALENDAR OBJX
BUTTON OBJX
Download Center
TRIALS
UPDATES
Purchase Center
ORDER NOW
GOVT / GSA
LICENSE AGREEMENT
WORLDWIDE RESELLERS
CORPORATE DISCOUNTS
WHY BUY?
Support Center
TECHNICAL SUPPORT
FORUM
SUPPORT OPTIONS
VIDEO LIBRARY
SECTION 508
TRAINING CLASSES
Our Company
CUSTOMERS SAY...
ABOUT US
CONTACT US
JOB OPENINGS
AWARDS
CASE STUDIES
WHY CHOOSE FARPOINT
FarPoint Technologies
(800) 645-5913
fpsales@fpoint.com
»
Spread for Windows Forms
»
Product Tour
»
Models
»
Selection
Understanding Selection Data Model
Back to Top
Selection Model
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.
The default implementation of the selection model (BaseSheetSelectionModel) handles the selection of cells and ranges in the sheet, and stores the actual cell and range coordinates for each selection. The SpreadView object handles the user interface for the SheetView object and updates the selection model from various event handlers. 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. The SheetView.GetSelection method and SheetView.SelectionCount property are wrapping the ISheetSelectionModel indexer and Count property. When there is no selection in the model, the count is 0 and GetSelection returns null. 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. You should check the SelectionCount before using GetSelection, and in the case where it returns 0, use the ActiveColumnIndex and ActiveRowIndex properties.
Have a question?
RSS Subscribe
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.