Tab
A newer version of this page is available. Switch to the current version.

ASPxGridExportSettings.EnableClientSideExportAPI Property

Gets or sets a value specifying whether the client exporting API is enabled.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue(false)]
public bool EnableClientSideExportAPI { get; set; }
<DefaultValue(False)>
Public Property EnableClientSideExportAPI As Boolean

Property Value

Type Default Description
Boolean

false

true, to enable client exporting API; otherwise, false.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to EnableClientSideExportAPI
ASP.NET Controls and MVC Extensions ASPxCardView
.SettingsExport.EnableClientSideExportAPI
ASPxGridView
.SettingsExport.EnableClientSideExportAPI
ASPxVerticalGrid
.SettingsExport.EnableClientSideExportAPI
MVCxCardView
.SettingsExport.EnableClientSideExportAPI
MVCxGridView
.SettingsExport.EnableClientSideExportAPI
MVCxVerticalGrid
.SettingsExport.EnableClientSideExportAPI
ASP.NET Bootstrap Controls BootstrapCardView
.SettingsExport.EnableClientSideExportAPI
BootstrapGridView
.SettingsExport.EnableClientSideExportAPI

Remarks

Exporting grid data using built-in toolbar/context menu commands and client-side API is disabled by default due to possible security issues. To enable such grid exporting functionality, set the EnableClientSideExportAPI property to true.

The following examples illustrate how to use the EnableClientSideExportAPI property.

ASPxGridView

Examples

  • Export using built-in toolbar commands

    
    <dx:ASPxGridView ID="Grid" runat="server" KeyFieldName="ProductID" DataSourceID="ProductsDataSource" Width="100%"> 
    <SettingsExport EnableClientSideExportAPI="true"></SettingsExport>
        <Toolbars> 
        <dx:GridViewToolbar EnableAdaptivity="true"> 
                <Items> 
                    <dx:GridViewToolbarItem Command="ExportToXls" /> 
                    <dx:GridViewToolbarItem Command="ExportToXlsx" /> 
                    <dx:GridViewToolbarItem Command="ExportToCsv" /> 
                </Items> 
            </dx:GridViewToolbar> 
        </Toolbars> 
        <Columns> 
        ...
        </Columns> 
    </dx:ASPxGridView> 
    
  • Export using context menu commands

    
    <dx:ASPxGridView runat="server" ID="Grid" ClientInstanceName="Grid" Width="100%" EnableRowsCache="false" DataSourceID="DemoDataSource1" KeyFieldName="ProductID"
        OnFillContextMenuItems="Grid_FillContextMenuItems">
        <Columns>
        ...
        </Columns>
        <SettingsExport EnableClientSideExportAPI="true" ExcelExportMode="DataAware" />
        <SettingsContextMenu Enabled="true" />
        ...
    </dx:ASPxGridView>
    
  • Export using client-side export API

    
    <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

Online Demos

ASPxCardView

Examples

  • Export using built-in toolbar commands

    
    <dx:ASPxCardView ID="cardView" runat="server" DataSourceID="ProductsDataSource" KeyFieldName="ProductID" AutoGenerateColumns="False">
        <Toolbars>
            <dx:CardViewToolbar EnableAdaptivity="true">
                <Items>
                    <dx:CardViewToolbarItem Command="ExportToPdf" />
                    <dx:CardViewToolbarItem Command="ExportToXls" />
                    <dx:CardViewToolbarItem Command="ExportToXlsx" />
                    <dx:CardViewToolbarItem Command="ExportToDocx" />
                    <dx:CardViewToolbarItem Command="ExportToRtf" />
                </Items>
            </dx:CardViewToolbar>
        </Toolbars>
        <Columns>
        ...
        </Columns>
        <SettingsExport EnableClientSideExportAPI="true" CardWidth="300" />
    </dx:ASPxCardView>
    
  • Export using client-side export API

    <