Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WorkbookImportOptions.ThrowExceptionOnInvalidDocument Property

Specifies whether an exception should be thrown when importing an invalid document.

Namespace: DevExpress.XtraSpreadsheet.Import

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

public bool ThrowExceptionOnInvalidDocument { get; set; }

#Property Value

Type Description
Boolean

true, if an exception is thrown when importing an invalid document; otherwise, false.

#Property Paths

You can access this nested property as listed below:

Object Type Path to ThrowExceptionOnInvalidDocument
DocumentOptions
.Import .ThrowExceptionOnInvalidDocument

#Remarks

Every time you try to load an invalid document into the SpreadsheetControl or Workbook, the SpreadsheetControl.InvalidFormatException or Workbook.InvalidFormatException event fires. You can subscribe to this event and perform the actions required to resolve this situation (for example, inform an end-user about the incorrect file). If the ThrowExceptionOnInvalidDocument property is set to true, an exception is thrown after the InvalidFormatException event has occurred.

See Also