The requested page is not available for the requested platform. You are viewing the content for Default platform.

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