Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

Workbook.InvalidFormatException Event

Fires when the supplied data could not be recognized as data in the assumed format for import.

You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use this event in production code.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Docs.v19.1.dll

Declaration

public event InvalidFormatExceptionEventHandler InvalidFormatException

Event Data

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

Property Description
Exception Gets the exception which triggers the InvalidFormatException event.
SourceUri Gets the source location for the document which triggers the InvalidFormatException event.

Remarks

If the data for import is in an incorrect format, the spreadsheet component silently cancels import if the InvalidFormatException is not handled. If you subscribe to the InvalidFormatException event, the event is fired when the component attempts to load incorrect data, so you can provide custom logic in this situation.

To throw an exception on loading an invalid document, set the WorkbookImportOptions.ThrowExceptionOnInvalidDocument property to true (import options are accessible via the Workbook.Options.Import notation).

See Also