Skip to main content

TreeList.LockReloadNodes() Method

In bound mode, prevents updates of the tree structure when adding and deleting nodes and changing nodes’ parents via the Tree List or data source, until the TreeList.UnlockReloadNodes method is called.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v22.2.dll

NuGet Package: DevExpress.Win.TreeList


public virtual void LockReloadNodes()


The LockReloadNodes and TreeList.UnlockReloadNodes methods should be used together to avoid excessive updates of the internal tree structure when adding and deleting nodes and changing nodes’ parents in bound mode (via the Tree List control or underlying data source). In unbound mode, use the TreeList.BeginUnboundLoad and TreeList.EndUnboundLoad methods instead.

When adding or deleting a node or when changing a node’s parent the Tree List control re-builds its node structure. So, when performing multiple such changes simultaneously, the control will be updated multiple times. To prevent excessive multiple data updates and improve the control’s performance, use the LockReloadNodes and TreeList.UnlockReloadNodes methods. Wrap the code that modifies the node structure with LockReloadNodes and UnlockReloadNodes method calls. In this instance, the node structure will be updated only once, reflecting all the changes made by the UnlockReloadNodes method.

Note that the LockReloadNodes and TreeList.UnlockReloadNodes methods do not prevent multiple visual updates when performing multiple view customization operations simultaneously. To prevent excessive visual updates, use the TreeList.BeginUpdate and TreeList.EndUpdate methods instead.

The LockReloadNodes and TreeList.UnlockReloadNodes methods also do not prevent multiple updates when changing specific options or node values that affect the order of nodes. To prevent these updates, use the TreeList.BeginSort and TreeList.EndSort methods.

See Also