Skip to main content

TreeListMultiSelection.BeginSelect() Method

Prevents selection updates until the TreeListMultiSelection.EndSelect method is called.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v24.1.dll

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

Declaration

public void BeginSelect()

Remarks

Use the BeginSelect 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 BeginSelect 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 have been performed, call the TreeListMultiSelection.EndSelect method. This method allows future selection updates and forces an immediate update. Using the BeginSelect and TreeListMultiSelection.EndSelect methods allow you to perform a single TreeList update when performing several selection modifications, which results in improved performance.

The TreeList‘s TreeList.BeginSelection method is equivalent to the current method.

To enable selection updates after the BeginSelect method call but without an immediate update, call the TreeListMultiSelection.CancelSelect method.

Note

Each call of the BeginSelect method should correspond to the TreeListMultiSelection.EndSelect or TreeListMultiSelection.CancelSelect method call. To ensure that the method 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