Skip to main content
.NET 8.0+

IDataAwareExportable Interface

Implemented by List Editors that support data-aware export to Excel formats.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public interface IDataAwareExportable

Remarks

Built-in List Editors that implement this interface are GridListEditor and ASPxGridListEditor. For these classes, the DataAware ExportType is used by default when exporting to Excel formats. For other List Editors that do not implement IDataAwareExportable, the WYSIWYG export type is used.

The IDataAwareExportable interface declares no members itself. However, it is implemented by the following interfaces that 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();
    }
}
See Also