Skip to main content

ASPxClientGridView.ExportTo(format) Method

Exports a grid data to a file in the specified format.

Declaration

ExportTo(
    format: ASPxClientGridViewExportFormat
): void

Parameters

Name Type Description
format ASPxClientGridViewExportFormat

The export format.

Remarks

Note

The ExportTo method is in effect if the EnableClientSideExportAPI property is set to true.

The following example illustrates how to use the ExportTo method for exporting the grid data.

<dx:ASPxGridView runat="server" ID="ASPxGridView1" ClientInstanceName="grid" 
    DataSourceID="CustomerReportsDataSource">
    <SettingsExport EnableClientSideExportAPI="true"/>
</dx:ASPxGridView>

<dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" Text="Export to XLS">
    <ClientSideEvents Click="function(s, e) {
        grid.ExportTo(ASPxClientGridViewExportFormat.Xls);
    }" />
</dx:ASPxButton>

Online Demos

See Also