Skip to main content

ASPxSpreadsheet.ViewModeChanging Event

Fires before the control’s view mode is changed and allows you to cancel the action.

Namespace: DevExpress.Web.ASPxSpreadsheet

Assembly: DevExpress.Web.ASPxSpreadsheet.v23.1.dll

NuGet Package: DevExpress.Web.Office


public event ViewModeChangingEventHandler ViewModeChanging

Event Data

The ViewModeChanging event's data class is ViewModeChangingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
NewMode A value specifying the view mode


The Spreadsheet control provides the Reading view mode that simplifies viewing documents on mobile devices. When the control in this view mode, all documents are opened in the read-only mode, and the ribbon toolbar is replaced with the specific toolbar for the Reading view mode. The Reading view mode is an alternative to the Editing view mode - the view mode that provides the standard full-featured Spreadsheet.

Use this event to prepare the control for switching between the Reading and Editing view modes. For example, you can customize the control’s toolbar in the Reading view mode as demonstrated in the following code snippet:

<dx:ASPxSpreadsheet ID="Spreadsheet" runat="server" OnViewModeChanging="Spreadsheet_ViewModeChanging">
    <SettingsView Mode="Reading" />

See the full example in the online demo.

See Also