Skip to main content

ASPxTreeListPrintSettings.ExpandAllNodes Property

Gets or sets a value specifying which nodes of an ASPxTreeList should present in the export result.

Namespace: DevExpress.Web.ASPxTreeList

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

NuGet Package: DevExpress.Web

Declaration

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

Property Value

Type Default Description
Boolean false

true, to export the ASPxTreeList with all nodes expanded regardless of their expanded state; otherwise, false.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to ExpandAllNodes
ASP.NET MVC Extensions MVCxTreeListSettingsExport
.PrintSettings .ExpandAllNodes
ASP.NET Web Forms Controls ASPxTreeListExporter
.Settings .ExpandAllNodes

Remarks

In data-bound or unbound mode, use this property to control whether ASPxTreeList should be exported with all its nodes expanded regardless of their current expanded state. If the ExpandAllNodes property is set to false (the default value), ASPxTreeList will be exported in its current state. Set the ExpandAllNodes property to true, if you want the export result to contain all nodes expanded.

Setting the ExpandAllNodes property to true in virtual mode does not result in exporting ASPxTreeList with all its nodes expanded. In virtual mode, only visible nodes can be exported (these are nodes that belong to the currently opened parent nodes). If a child node was visible, but then its parent node has been collapsed, the export result will not contain such a child node. A workaround for virtual mode would be to use ASPxTreeList’s ASPxTreeList.VirtualModeNodeCreated event and expand every created node.

MVC approach:

settings.VirtualModeNodeCreated += (s, e) => {
    e.Node.Expanded = true;
};

Web Forms approach:

protected void treeList_VirtualModeNodeCreated(object sender, TreeListVirtualNodeEventArgs e)
{
    e.Node.Expanded = true;
}
See Also