Back to Devexpress

ASPxTreeListExporter Class

aspnet-devexpress-dot-web-dot-aspxtreelist-9f890ce9.md

latest3.5 KB
Original Source

ASPxTreeListExporter Class

Represents an ASPxTreeListExporter control used to export the ASPxTreeList control’s data.

Namespace : DevExpress.Web.ASPxTreeList

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

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxTreeListExporter :
    Control,
    IBasePrintable,
    ITreeListExportOwner
vb
Public Class ASPxTreeListExporter
    Inherits Control
    Implements IBasePrintable,
               ITreeListExportOwner

Remarks

The ASPxTreeListExporter component allows the ASPxTreeList’s data to be exported to a file or stream in various formats - PDF, RTF and XLS. To export data, assign the required ASPxTreeList’s ID to the ASPxTreeListExporter.TreeListID property, and use the export method you desire. For example, to export data to a file in XLS format, use the ASPxTreeListExporter.WriteXlsToResponse method.

Note

The ASPxTreeListExporter doesn’t export the content of template columns, and data columns that are hidden.

Example

This example shows how to draw department names in an exported document, based on their budget. Department names are painted in Orange if their budget is less than $100,000.

The image below shows the result:

csharp
using DevExpress.Web.ASPxTreeList;

protected void ASPxTreeListExporter1_RenderBrick(object sender,
DevExpress.Web.ASPxTreeList.Export.ASPxTreeListExportRenderBrickEventArgs e) {
    if (e.RowKind == TreeListRowKind.Data && e.Column != null &
        e.Column.FieldName == "Department") {
        if (Convert.ToInt32(ASPxTreeList1.FindNodeByKeyValue(e.NodeKey)["Budget"]) < 100000)
            e.BrickStyle.BackColor = System.Drawing.Color.Orange;
    }
}

Implements

IComponent

IDisposable

IParserAccessor

IUrlResolutionService

IDataBindingsAccessor

IControlBuilderAccessor

IControlDesignerAccessor

IExpressionsAccessor

IBasePrintable

Inheritance

Object Control ASPxTreeListExporter MVCxTreeListExporter

See Also

ASPxTreeListExporter Members

DevExpress.Web.ASPxTreeList Namespace