aspnet-js-aspxclientgridview-dot-exportto-x28-format-x29.md
Exports a grid data to a file in the specified format.
ExportTo(
format: ASPxClientGridViewExportFormat
): void
| Name | Type | Description |
|---|---|---|
| format | ASPxClientGridViewExportFormat |
The export format.
|
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>
See Also