[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Collapse]Spreadsheet
   [Expand]Product Information
    Product Structure
    Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
    Data Grouping
   [Expand]Pivot Tables
   [Expand]Charts and Graphics
    Printing
    Events
   [Expand]Mail Merge
    Protection
    Operation Restrictions
    Find and Replace
   [Expand]Visual Elements
    Services
   [Expand]Keyboard Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Operation Restrictions

Use the SpreadsheetControlOptions.Behavior property to access the Spreadsheet control's restriction settings. You can set these options to the following values:

Expanded Disable Workbook Operations

Use the following properties to restrict operations users can perform on workbooks:

Restriction Description
SpreadsheetBehaviorOptions.CreateNew Specifies whether users can create new documents.
SpreadsheetBehaviorOptions.Open Specifies whether users can open documents.
SpreadsheetBehaviorOptions.Drop Specifies whether users can drag and drop files onto the Spreadsheet control.
SpreadsheetBehaviorOptions.Save Specifies whether users can save changes in an existing document.
SpreadsheetBehaviorOptions.SaveAs Specifies whether users can save new documents.
SpreadsheetProtectionBehaviorOptions.ProtectWorkbook Specifies whether users can protect workbooks.
SpreadsheetProtectionBehaviorOptions.UnprotectWorkbook Specifies whether users can remove workbook protection.
SpreadsheetBehaviorOptions.Encrypt Specifies whether users can encrypt documents with a password.
SpreadsheetBehaviorOptions.Print Specifies whether users can print documents.

The example below shows how to disable the New and Open operations in the Spreadsheet control.

Expanded Disable Worksheet Operations

Use the following properties to restrict operations users can perform on worksheets:

Restriction Description
SpreadsheetWorksheetBehaviorOptions.Insert Specifies whether users can insert worksheets.
SpreadsheetWorksheetBehaviorOptions.Delete Specifies whether users can delete worksheets.
SpreadsheetWorksheetBehaviorOptions.Hide Specifies whether users can hide worksheets.
SpreadsheetWorksheetBehaviorOptions.Unhide Specifies whether users can unhide worksheets.
SpreadsheetWorksheetBehaviorOptions.Rename Specifies whether users can rename worksheets.
SpreadsheetProtectionBehaviorOptions.ProtectSheet Specifies whether users can protect worksheets.
SpreadsheetProtectionBehaviorOptions.UnprotectSheet Specifies whether users can remove worksheet protection.
SpreadsheetWorksheetBehaviorOptions.TabColor Specifies whether users can apply a background color to sheet tabs.
SpreadsheetBehaviorOptions.OfficeScrolling Specifies whether automatic scrolling is enabled.
SpreadsheetBehaviorOptions.Zooming Specifies whether users can zoom in and out of worksheets.
SpreadsheetBehaviorOptions.MaxZoomFactor Defines the maximum zoom factor.
SpreadsheetBehaviorOptions.MinZoomFactor Defines the minimum zoom factor.

The example below shows how to hide the Delete Sheet and Hide Sheet commands in the Spreadsheet control.

Expanded Disable Row and Column Operations

Use the following properties to restrict operations users can perform on rows and columns:

Restriction Description
SpreadsheetRowBehaviorOptions.Insert Specifies whether users can insert rows.
SpreadsheetRowBehaviorOptions.Delete Specifies whether users can delete rows.
SpreadsheetRowBehaviorOptions.Hide Specifies whether users can hide rows.
SpreadsheetRowBehaviorOptions.Unhide Specifies whether users can unhide rows.
SpreadsheetRowBehaviorOptions.Resize Specifies whether users can resize rows.
SpreadsheetRowBehaviorOptions.AutoFit Specifies whether users can use AutoFit for rows.
SpreadsheetColumnBehaviorOptions.Insert Specifies whether users can insert columns.
SpreadsheetColumnBehaviorOptions.Delete Specifies whether users can delete columns.
SpreadsheetColumnBehaviorOptions.Hide Specifies whether users can hide columns.
SpreadsheetColumnBehaviorOptions.Unhide Specifies whether users can unhide columns.
SpreadsheetColumnBehaviorOptions.Resize Specifies whether users can resize columns.
SpreadsheetColumnBehaviorOptions.AutoFit Specifies whether users can use AutoFit for columns.
SpreadsheetBehaviorOptions.FreezePanes Specifies whether users can freeze rows and columns.
SpreadsheetBehaviorOptions.Group Specifies whether users can group or ungroup rows and columns.

The example below shows how to disable the Delete operation for row and columns in the Spreadsheet control.

Expanded Disable Cell Operations

Use the following properties to restrict operations users can perform on cells and cell ranges:

Restriction Description
SpreadsheetBehaviorOptions.Drag Specifies whether users can drag cell ranges, drawings objects, and comments.
SpreadsheetBehaviorOptions.MoveRange Specifies whether users can move cell ranges.
SpreadsheetBehaviorOptions.FillHandle Allows you to show or hide the fill handle.
SpreadsheetBehaviorOptions.CellEditor Specifies whether the SpreadsheetControl.CellValueChanged event should occur each time a user edits a cell value or only if a value was changed.
SpreadsheetSelectionOptions.AllowExtendSelection Specifies whether users can use the mouse or arrow keys to extend the cell selection.
SpreadsheetSelectionOptions.AllowMultiSelection Specifies whether users can select multiple cell ranges or drawing objects in a worksheet.
SpreadsheetSelectionOptions.HideSelection Specifies whether to highlight the selected cells in the Spreadsheet control.
SpreadsheetSelectionOptions.MoveActiveCellMode Specifies the direction in which an active cell moves when the ENTER key is pressed.
SpreadsheetSelectionOptions.ShowSelectionMode Specifies whether to highlight selection when the Spreadsheet control does not have focus.
SpreadsheetProtectionBehaviorOptions.AllowUsersToEditRange Specifies whether users can grant permission to specific users to edit ranges in a protected worksheet.
SpreadsheetBehaviorOptions.Comment Specifies whether users can create or modify Comments.
SpreadsheetBehaviorOptions.DataValidation Specifies whether users can create or modify data validation rules.
SpreadsheetBehaviorOptions.UseSkinColors Specifies whether to use skin colors for a cell's font and background.

The example below shows how to disable multiple selection in the Spreadsheet control and change the direction in which an active cell moves when a user presses ENTER.

Expanded Disable Clipboard Operations

Use the following properties to restrict clipboard operations:

Restriction Description
SpreadsheetBehaviorOptions.Cut Specifies whether users can perform the Cut operation.
SpreadsheetBehaviorOptions.Copy Specifies whether users can perform the Copy operation.
SpreadsheetBehaviorOptions.Paste Specifies whether users can perform the Paste operation.

The example below shows how to disable clipboard operations in the Spreadsheet control.

Expanded See Also

Is this topic helpful?​​​​​​​