Skip to main content

TreeListExtension.BindToVirtualData(TreeListVirtualModeCreateChildrenMethod, TreeListVirtualModeNodeCreatingMethod) Method

Allows creation of treelist nodes on demand (virtual mode).

Namespace: DevExpress.Web.Mvc

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

NuGet Package: DevExpress.Web.Mvc5

Declaration

public TreeListExtension BindToVirtualData(
    TreeListVirtualModeCreateChildrenMethod createChildrenMethod,
    TreeListVirtualModeNodeCreatingMethod nodeCreatingMethod
)

Parameters

Name Type Description
createChildrenMethod TreeListVirtualModeCreateChildrenMethod

A delegate method of the TreeListVirtualModeCreateChildrenMethod type that enables you to create a list of business objects that correspond to the child nodes owned by the processed node.

nodeCreatingMethod TreeListVirtualModeNodeCreatingMethod

A delegate method of the TreeListVirtualModeNodeCreatingMethod type that enables you to specify the node’s key value and cell values.

Returns

Type Description
TreeListExtension

A TreeListExtension object that is the TreeList.

Remarks

In addition to bound and unbound modes, the TreeList extension can operate in Virtual Mode, which greatly reduces both the server load and start-up time when working with complex or dynamically created data. In virtual mode, a tree is created on demand. In this instance, child nodes are created and initialized when their parent node is expanded.

To implement a virtual mode for the TreeList extension, a specifically parameterized BindToVirtualData method can be used. The method’s parameters refer to delegate methods that can be declared as static methods within a model class. Within the first delegate method, create a list of business objects that correspond to the child nodes owned by the processed node. The second one enables you to specify the node’s key value and cell values.

See Also