The BeginSelection method, paired with the BaseView.EndSelection/BaseView.CancelSelection method, allows you to improve the grid performance when successively selecting a batch of rows/cells in code. See the Multiple Row and Cell Selection topic, to learn about the methods to select and unselect rows and cells.
If not using the BeginSelection method, the View is updated and the ColumnView.SelectionChanged event fires after every single selection modification. The BeginSelection method, when called prior to changing the selection in code, suspends selection updates until the BaseView.EndSelection or BaseView.CancelSelection method is called.
The EndSelection and CancelSelection methods enable future selection updates, but unlike CancelSelection, the EndSelection method forces an immediate visual update and fires the ColumnView.SelectionChanged event.
Each call of the BeginSelection method must correspond to a call of the BaseView.EndSelection or the BaseView.CancelSelection method. To ensure that BaseView.EndSelection or BaseView.CancelSelection is always called even if an exception occurs, use the try…finally statement.