Skip to main content
A newer version of this page is available. .

TreeList.BeginSelection() Method

Prevents selection updates until the TreeList.EndSelection method is called.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.2.dll

Declaration

public virtual void BeginSelection()

Remarks

Use the BeginSelection method when you need to perform several successive selection modifications in code. When not using this method, the TreeList is updated to reflect selection changes after each selection modification. If the BeginSelection method is called, the TreeList is not updated to reflect selection changes and doesn’t raise the TreeList.SelectionChanged event each time the selection is changed. When the desired selection modifications are performed, call the TreeList.EndSelection method. This method allows future selection updates and forces an immediate update. Using the BeginSelection and TreeList.EndSelection methods allow you to perform a single TreeList update when performing several selection modifications which results in improved performance.

Note

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

Refer to the Node Selection topic for more information on node and cell selection. The Batch Modifications Overview topic provides more details on batch modifications.

See Also