Skip to main content
A newer version of this page is available. .

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

An ASPxClientGridViewExportFormat object specifying the export format.

Remarks

Note

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

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

<dx:ASPxGridView ClientInstanceName="grid" ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID"> 
<SettingsExport EnableClientSideExportAPI="true" /> 
        <Columns> 
        ...
        </Columns> 
</dx:ASPxGridView> 
<br /> 
<dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" Text="Export"> 
    <ClientSideEvents Click="function(s, e) {
        grid.ExportTo(ASPxClientGridViewExportFormat.Xls);
    }" /> 
</dx:ASPxButton>

Concept

ASPxGridView Exporting

Online Demos

See Also