# Specifying What the User Can Select

Learn how to specify user selection options in your sheets, including cells, rows, columns, and the entire sheet with our comprehensive guide.

## Content

By default, sheets allow users to select a cell, a column, a row, a range of cells, or the entire sheet. You can customize how selection occurs and what can be selected by working with the operation mode of the sheet and with the selection policy and selection unit of the sheet.
The following table summarizes the options available for specifying what users can select:

| **What user can select** | **When setting this for the sheet** |
| -------------------- | ------------------------------- |
| Cells | FpSpread.[SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html).Cells |
| Rows | FpSpread.[SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html).Rows |
| Columns | FpSpread.[SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html).Columns |
| Sheet | FpSpread.[SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html).Sheet |
| Combination | FpSpread.[SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html).number where number is some addition of the numbers for the individual settings (such as 6 = 2 + 4, Rows and Columns) |
| Cells, ranges of cells, or multiple ranges of cells | [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html).Normal with [SelectionPolicy](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionPolicy.html) property |
| Only rows, no editing | [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html).SingleSelect |
| Only rows, editing | [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html).RowMode |
| Multiple contiguous rows, no editing | [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html).MultiSelect |
| Multiple noncontiguous rows, no editing | [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html).ExtendedSelect |

Note that the FpSpread.[SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html) are settings at the Spread component level, while the [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html) settings are at the sheet level.
The settings of the [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html) and the [SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html) properties affect user interaction with the sheet, that is, what the user can select, but not necessarily what the application can select. If you want to customize what the user and the application both can select, set the [SelectionUnit](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionUnit.html) property.
You can also restrict which cells can be edited by using the [RestrictRows](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.RestrictRows.html) and [RestrictColumns](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.RestrictColumns.html) methods for the sheet. This restricts users from entering data beyond the next row or column. For more information, refer to the [SelectionPolicy](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionPolicy.html) property and the [SelectionUnit](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionUnit.html) property of the [SheetView](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.html) class, and the [SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html) property of the [FpSpread](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.html) class. For more details, see the [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.OperationMode.html) and the [SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SelectionBlockOptions.html) enumerations.

## Using the Properties Window

1. At design time, in the **Properties** window, select the Spread 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. If you set the **OperationMode** property to Normal, and you want to allow users to select only a cell or to select multiple ranges of cells, set the **SelectionPolicy** property to Single or to MultiRange.
7. To set the overall selection interaction for the sheet, including how users and the application can select items, set the **SelectionUnit** property to specify the unit of selection allowed.
8. Click **OK** to close the editor.
9. If you want to customize what users can select in all sheets in the Spread component, set the **SelectionBlockOptions** property to specify whether they can select cells, columns, rows, the sheet or a combination of these.

## Using a Shortcut

1. To set the overall user interaction mode of the sheet, set the **Sheets** [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html) property.
2. If you set the [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html) property to Normal,
    1. If you want to customize what users can select in all sheets in the Spread component, set the **FpSpread** [SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html) property to specify whether they can select cells, columns, rows, the sheet or a combination of these.
    2. If you want to allow users to select only a cell or to select multiple ranges of cells, set the **Sheets** [SelectionPolicy](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionPolicy.html) property to Single or to MultiRange.
3. To set the overall selection interaction for the sheet, including how users and the application can select items, set the **Sheets** [SelectionUnit](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionUnit.html) property to specify the unit of selection allowed.

**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 in this example.

```csharp
// Set option so users can select only cells.
fpSpread1.SelectionBlockOptions = FarPoint.Win.Spread.SelectionBlockOptions.Cells;// Set operation mode and let users select multiple blocks of cells.fpSpread1.Sheets[0].OperationMode = FarPoint.Win.Spread.OperationMode.Normal;
fpSpread1.Sheets[0].SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange;
```

```vbnet
' Set option so users can select only cells.
fpSpread1.SelectionBlockOptions = FarPoint.Win.Spread.SelectionBlockOptions.Cells
' Set operation mode and let users select multiple blocks of cells.
fpSpread1.Sheets(0).OperationMode = FarPoint.Win.Spread.OperationMode.Normal
fpSpread1.Sheets(0).SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange
```

## Using Code

1. To set the overall user interaction mode of the sheet, set the [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html) property for a **SheetView** object.
2. If you set the [OperationMode](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.OperationMode.html) property to Normal,
    1. If you want to customize what users can select in all sheets in the Spread component, set the **FpSpread** [SelectionBlockOptions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.SelectionBlockOptions.html) property to specify whether they can select cells, columns, rows, the sheet or a combination of these.
    2. If you want to allow users to select only a cell or to select multiple ranges of cells, set the **SheetView** object [SelectionPolicy](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionPolicy.html) property to Single or to MultiRange.
3. To set the overall selection interaction for the sheet, including how users and the application can select items, set the **SheetView** object [SelectionUnit](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.SelectionUnit.html) property to specify the unit of selection allowed.
4. Assign the **SheetView** object you have created to one of the sheets in the Spread 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 in this example.

```vbnet
' Set option so users can select only cells.
fpSpread1.SelectionBlockOptions = FarPoint.Win.Spread.SelectionBlockOptions.Cells
' Set operation mode and let users select multiple blocks of cells.
Dim newsheet As New FarPoint.Win.Spread.SheetView()
newsheet.OperationMode = FarPoint.Win.Spread.OperationMode.Normal
newsheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.MultiRange
' 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 general (**Sheet Settings** section). In the **Sheet Settings** dialog, on the **General** tab, select one of the choices from the **Operation Mode** area.
3. Click **OK** to close the **Sheet Settings** dialog.
4. If you set the **OperationMode** property to Normal,
    1. If you want to customize what users can select in all sheets in the Spread component, set the **SelectionBlockOptions** property (for the selected Spread) in the **Properties** list to specify whether they can select cells, columns, rows, the sheet or a combination of these.
    2. If you want to allow users to select only a cell or to select multiple ranges of cells, set the **SelectionPolicy** property (for the selected Sheet) in the **Properties** list to Single or to MultiRange.
5. To set the overall selection interaction for the sheet, including how users and the application can select items, set the **SelectionUnit** property (for the selected Sheet) in the **Properties** list to specify the unit of selection allowed.
6. From the **File** menu choose **Apply and Exit** to apply your changes to the component and exit Spread Designer.

## See Also

[Customizing the Selection Appearance](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interactcell/spwin-interactselection/spwin-selsetappear)
[Working with Selections](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interactcell/spwin-interactselection/spwin-seladdremove)
[Hiding the Selection When Focus is Lost](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interactcell/spwin-interactselection/spwin-selhidenofocus)
[Working with Deselections](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-interactcell/spwin-interactselection/working-with-deselections)