Spread for ASP.NET 12 Product Documentation
Specifying What the User Can Select
Spread for ASP.NET 12 Product Documentation > Developer's Guide > Customizing User Interaction > Customizing Selections of Cells > Specifying What the User Can Select

By default, the component allows users to select a cell, a column, a row, a range of cells, or the entire sheet. You can customize what the user can select by working with the operation mode of the sheet (OperationMode property). The settings are based on the OperationMode enumeration. You can specify what the user is allowed to select in normal operation mode with the SelectionBlockOptions property. You can allow the user to select multiple blocks in normal operation mode with the SelectionPolicy property.

The settings of the OperationMode property affect user interaction with the sheet, that is, what the user can select, but not necessarily what the application can select.

Selected row and editable cell

The following table summarizes the options available for specifying what users can select and edit on the sheet:

User can select User can edit OperationMode Setting
Cell, row, column, any range of cells, entire sheet Active cell Normal
Only one row Active Cell RowMode
Only one row Nothing SingleSelect
Nothing Nothing ReadOnly
Multiple contiguous rows Nothing MultiSelect
Multiple discontiguous rows Nothing ExtendedSelect

Using the Properties Window

  1. At design time, in the Properties window, select the FpSpread component.
  2. Select the Sheets property.
  3. Click the button to display the SheetView Collection Editor.
  4. In the Members list, select the sheet for which to set the operation mode.
  5. Select the OperationMode property, then select one of the values from the drop-down list of values.
  6. Click OK to close the editor.

Using a Shortcut

  1. To set the overall user interaction mode of the sheet, set the Sheet’s OperationMode property.

Example

This example code sets the sheet to allow users to select only rows and only edit the active cell.

C#
Copy Code
// Set the operation mode and let users select only rows.
fpSpread1.Sheets[0].OperationMode = FarPoint.Web.Spread.OperationMode.RowMode; 
VB
Copy Code
' Set the operation mode and let users select only rows.
FpSpread1.Sheets(0).OperationMode = FarPoint.Web.Spread.OperationMode.RowMode 

Using Code

  1. To set the overall user interaction mode of the sheet, set the OperationMode property for a SheetView object.
  2. Assign the SheetView object you have created to one of the sheets in the component.

Example

This example code sets the sheet to allow users to select only cells or ranges of cells, including multiple ranges of cells. They cannot select columns, rows, or the entire sheet.

C#
Copy Code
// Set operation mode and let users select only a row.
FarPoint.Web.Spread.SheetView newsheet = new FarPoint.Web.Spread.SheetView();
newsheet.OperationMode = FarPoint.Web.Spread.OperationMode.RowMode;
// Assign the SheetView object to a sheet.
fpSpread1.Sheets[0] = newsheet; 
VB
Copy Code
' Set operation mode and let users select only a row.
Dim newsheet As New FarPoint.Web.Spread.SheetView()
newsheet.OperationMode = FarPoint.Web.Spread.OperationMode.RowMode
' Assign the SheetView object to a sheet.
FpSpread1.Sheets(0) = newsheet 

Using the Spread Designer

  1. Select the sheet tab for the sheet for which you want to set the selection operation mode.
  2. From the Settings menu, select the General icon, then select one of the choices from the Operation Mode area.
  3. Click OK to close the Sheet Settings dialog.
  4. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.