Files to look at:
- HomeController.cs (VB: HomeController.vb)
- TreeListVirtualModeHelper.cs (VB: TreeListVirtualModeHelper.vb)
- _TreeListPartial.cshtml
- Index.cshtml
Virtual mode is useful if there's a lot of data and it's not necessary or impossible to create a tree at once. To implement 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 within a model class. For this, a special TreeListVirtualModeHelper class with the required methods was created. To implement the drag-and-drop functionality, it's necessary to define the SettingsEditing.NodeDragDropRouteValues property.
Note that node dragging is an editing operation, because while changing the node's position, its parent row identificator changes. The MoveNode method was created to accept changes on the controller.