Skip to main content

TreeList.BeginDelete() Method

Prevents deletion updates until the TreeList.EndDelete method is called.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.1.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

public void BeginDelete()

Remarks

Use the BeginDelete method when you need to perform several successive deletions in code. If not using this method, the TreeList is updated to reflect changes after each deletion. If the BeginDelete method is called, the TreeList is not updated to reflect deletion changes. When the desired deletions are performed, call the TreeList.EndDelete method. This method allows future deletion updates and forces an immediate update. The BeginDelete and TreeList.EndDelete methods allow you to perform a single TreeList update when performing several deletions, which results in improved performance.

Note

Each call of the BeginDelete method should correspond to the TreeList.EndDelete method call. To ensure that TreeList.EndDelete is always called even if an exception occurs, use the try…finally statement.

The BeginDelete and TreeList.EndDelete methods call the TreeList.BeginUpdate and TreeList.EndUpdate internally. So, the BeginDelete and TreeList.EndDelete methods also prevent excessive visual updates, and there is no need to use theTreeList.BeginUpdate and TreeList.EndUpdate methods to do this.

The Batch Modifications Overview topic provides more details on batch modifications.

See Also