A newer version of this page is available. Switch to the current version.

ExportController.ExportActionItemsCreated Event

Occurs after the Export Action’s ChoiceActionBase.Items collection has been populated.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v18.2.dll


public event EventHandler<EventArgs> ExportActionItemsCreated

Event Data

The ExportActionItemsCreated event's data class is EventArgs.


By default, the Export Action’s Items collection is populated based on the IExportable.SupportedExportFormats list of the Controller’s ExportController.Exportable editor. To customize the Items collection after it’s been populated, handle the ExportActionItemsCreated event. Note that the exporter used by default can only export data to the formats specified by the ExportTarget enumeration. So, the Action’s Items must be of the ExportTarget type only, if you use the default export.


If the control of the Controller’s ExportController.Exportable Editor doesn’t implement the IPrintable interface or the Exportable Editor is not specified, the Export Action’s Items collection remains empty, the ExportActionItemsCreated event is not raised and the Export Action is not activated.

The following code demonstrates how to place the required item to the first place in the Export Action’s Items collection:

using DevExpress.ExpressApp.SystemModule;
using DevExpress.XtraPrinting;
public partial class MyExportViewController : ViewController {
    public MyExportViewController() {
        TargetViewType = ViewType.ListView;
    private ExportController exportController;
    protected override void OnActivated() {
        exportController = Frame.GetController<ExportController>();
        if (exportController != null) {
            exportController.ExportActionItemsCreated += 
                new EventHandler<EventArgs>(exportController_ExportActionItemsCreated);
    void exportController_ExportActionItemsCreated(object sender, EventArgs e) {
        if (((ExportTarget)exportController.ExportAction.Items.FirstActiveItem.Data) != 
        ExportTarget.Xls) {
            ChoiceActionItem item = exportController.ExportAction.Items.Find(ExportTarget.Xls);
            exportController.ExportAction.Items.Insert(0, item);
    protected override void OnDeactivated() {
        if (exportController != null) {
            exportController.ExportActionItemsCreated -= 
               new EventHandler<EventArgs>(exportController_ExportActionItemsCreated); 
See Also