Skip to main content

MVCxTreeListSettingsExport.EnableClientSideExportAPI Property

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

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public bool EnableClientSideExportAPI { get; set; }

Property Value

Type Description
Boolean

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

Property Paths

You can access this nested property as listed below:

Object Type Path to EnableClientSideExportAPI
TreeListSettings
.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

    settings.Toolbars.Add(t => {
        t.EnableAdaptivity = true;
        t.Items.Add(TreeListToolbarCommand.ExportToPdf);
        t.Items.Add(TreeListToolbarCommand.ExportToXls);
        t.Items.Add(TreeListToolbarCommand.ExportToXlsx);
        t.Items.Add(TreeListToolbarCommand.ExportToDocx);
        t.Items.Add(TreeListToolbarCommand.ExportToRtf);
    });
    settings.SettingsExport.EnableClientSideExportAPI = true;
    
  • Exporting using client-side export API

    @Html.DevExpress().TreeList(settings => {
        settings.Name = "TreeList";
        settings.SettingsExport.EnableClientSideExportAPI = true;
        ...
    }).Bind(Model).GetHtml()
    ...
    <div class="button">
        @Html.DevExpress().Button(s => {
            s.Name = "ExpBtn";
            s.Text = "Export";
            s.AutoPostBack = "false";
            s.ClientSideEvents.Click = "function(s,e){ TreeList.ExportTo(ASPxClientTreeListExportFormat.Xls);}";
        }).GetHtml()
    

Online Demo

Exporting Data

See Also