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.
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 |
Return to Customizing Selections of Cells.
Using the Properties Window
- At design time, in the Properties window, select the FpSpread component.
- Select the Sheets property.
- Click the button to display the SheetView Collection Editor.
- In the Members list, select the sheet for which to set the operation mode.
- Select the OperationMode property, then select one of the values from the drop-down list of values.
- Click OK to close the editor.
Using a Shortcut
- 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
- To set the overall user interaction mode of the sheet, set the OperationMode property for a SheetView object.
- 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
- Select the sheet tab for the sheet for which you want to set the selection operation mode.
- From the Settings menu, select the General icon, then select one of the choices from the Operation Mode area.
- Click OK to close the Sheet Settings dialog.
- From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.