Spread for ASP.NET 8.0 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.
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 |
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
|
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 |