IDataAwareExportable Interface
Implemented by List Editors that support data-aware export to Excel formats.
Namespace: DevExpress.ExpressApp.SystemModule
Assembly: DevExpress.ExpressApp.v25.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Remarks
GridListEditor implements this interface. This class uses the DataAware ExportType by default when it exports to Excel formats. Other List Editors that do not implement IDataAwareExportable use the WYSIWYG export type.
The IDataAwareExportable interface declares no members. The following interfaces implement this interface and declare the format-specific Export method:
You can use the static ExportSettings.DefaultExportType property to switch from data-aware to the WYSIWYG mode of data export. Alternatively, you can handle the ExportController.CustomExport event as demonstrated in the How to: Customize the Export Action Behavior topic and customize the CustomExportEventArgs.ExportOptions parameter as follows:
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.Export;
// ...
public class CustomizeExportTypeController : ViewController {
private ExportController exportController;
protected override void OnActivated() {
base.OnActivated();
exportController = Frame.GetController<ExportController>();
if (exportController != null) {
exportController.CustomExport += CustomExport;
}
}
protected virtual void CustomExport(object sender, CustomExportEventArgs e) {
((IDataAwareExportOptions)e.ExportOptions).ExportType = ExportType.WYSIWYG;
}
protected override void OnDeactivated() {
if (exportController != null) {
exportController.CustomExport -= new EventHandler<CustomExportEventArgs>(CustomExport);
}
base.OnDeactivated();
}
}