Back to Devexpress

ASPxClientGridView.ExportTo(format) Method

aspnet-js-aspxclientgridview-dot-exportto-x28-format-x29.md

latest2.2 KB
Original Source

ASPxClientGridView.ExportTo(format) Method

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

Declaration

ts
ExportTo(
    format: ASPxClientGridViewExportFormat
): void

Parameters

NameTypeDescription
formatASPxClientGridViewExportFormat

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.

aspx
<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

EnableClientSideExportAPI

Export Grid View Data

ASPxClientGridView Class

ASPxClientGridView Members