TreeListExtension.BindToVirtualData(TreeListVirtualModeCreateChildrenMethod, TreeListVirtualModeNodeCreatingMethod) Method
Allows creation of treelist nodes on demand (virtual mode).
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.2.dll
NuGet Package: DevExpress.Web.Mvc5
#Declaration
public TreeListExtension BindToVirtualData(
TreeListVirtualModeCreateChildrenMethod createChildrenMethod,
TreeListVirtualModeNodeCreatingMethod nodeCreatingMethod
)
#Parameters
Name | Type | Description |
---|---|---|
create |
Tree |
A delegate method of the Tree |
node |
Tree |
A delegate method of the Tree |
#Returns
Type | Description |
---|---|
Tree |
A Tree |
#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.