How to hold the row selection after the cell is deactivated

15 Jun 20211 minute to read

Essential Grid enables you to hold the selection after the cell is deactivated. To hold the selection, cancel SelectionChanging event, when e.Reason is MouseDown or Clear.

void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
    if (e.Reason == GridSelectionReason.MouseDown || e.Reason == GridSelectionReason.Clear)
        e.Cancel = true;
Private Sub Model_SelectionChanging(ByVal sender As Object, ByVal e As GridSelectionChangingEventArgs)
    If e.Reason = GridSelectionReason.MouseDown OrElse e.Reason = GridSelectionReason.Clear Then
        e.Cancel = True
    End If
End Sub