TreeListExtension.BindToVirtualData(TreeListVirtualModeCreateChildrenMethod, TreeListVirtualModeNodeCreatingMethod) Method
Allows creation of treelist nodes on demand (virtual mode).
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v26.1.dll
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 supports Virtual Mode. This mode reduces server load and startup time for complex or dynamically generated hierarchies. In Virtual Mode, the tree is created on demand. 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.