Skip to main content

MVCxGridExportSettings.BeforeExport Property

Enables you to perform custom actions before the grid content is exported.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public ASPxGridBeforeExportEventHandler BeforeExport { get; set; }

Property Value

Type Description
ASPxGridBeforeExportEventHandler

An EventHandler method to which custom processing is delegated.

Property Paths

You can access this nested property as listed below:

Object Type Path to BeforeExport
GridSettingsBase
.SettingsExport .BeforeExport

Remarks

The following code snippet illustrates how to use the BeforeExport property.

settings.SettingsExport.BeforeExport = (sender, e) => {  
    MVCxGridView gridView = sender as MVCxGridView;

    // Hides the Action column
    gridView.Columns["Action"].Visible = false;
};

Note

Note that the BeforeExport property is not in effect if you use the CreatePrintableObject(GridViewSettings, Object) method. Instead, use the GridViewExtension.ExportTo[FormatName] methods.

View Example: How to use the BeforeExport event to filter the exported columns

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BeforeExport property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also