TreeListSettingsExport.EnableClientSideExportAPI Property
Gets or sets a value specifying whether the client exporting API is enabled.
Namespace: DevExpress.Web.ASPxTreeList
Assembly: DevExpress.Web.ASPxTreeList.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Default | Description |
---|---|---|
Boolean | false |
|
Property Paths
You can access this nested property as listed below:
Object Type | Path to EnableClientSideExportAPI |
---|---|
ASPxTreeList |
|
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