Skip to main content

TreeListSettingsExport.EnableClientSideExportAPI Property

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

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public bool EnableClientSideExportAPI { get; set; }

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:

Object Type Path to EnableClientSideExportAPI
ASPxTreeList
.SettingsExport .EnableClientSideExportAPI

Remarks

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

The following examples illustrate how to use the EnableClientSideExportAPI property.

  • Exporting using built-in toolbar commands

    <dx:ASPxTreeList ID="TreeList" runat="server" Width="100%" AutoGenerateColumns="False" DataSourceID="DepartmentsDataSource" KeyFieldName="ID" ParentFieldName="ParentID">
        <SettingsExport EnableClientSideExportAPI="True" />
        <Columns>
        ...
        </Columns>
        <Toolbars>
            <dx:TreeListToolbar EnableAdaptivity="true">
                <Items>
                    <dx:TreeListToolbarItem Command="ExportToPdf" />
                    <dx:TreeListToolbarItem Command="ExportToXls" />
                    <dx:TreeListToolbarItem Command="ExportToXlsx" />
                    <dx:TreeListToolbarItem Command="ExportToDocx" />
                    <dx:TreeListToolbarItem Command="ExportToRtf" />
                </Items>
            </dx:TreeListToolbar>
        </Toolbars>
    </dx:ASPxTreeList>
    
  • Exporting using client-side export API

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

Online Demo

Exporting to Different Formats

See Also