It is necessary that when the Ctrl key is pressed, the lines are highlighted, and the selection is not removed when you click again on one of the selected lines. That is - pressed Ctrl -> clicked on the line with the index 0 -> it became blue -> and no matter how many times we clicked on it, it will remain until Ctrl is pressed. How to do? Now I have this:
private void gridAction_KeyDown(object sender, KeyEventArgs e) { if (e.Control == true) gridAction.MultiSelect = true; } private void gridAction_KeyUp(object sender, KeyEventArgs e) { if (e.Control == false) gridAction.MultiSelect = false; } But I need to prohibit removing the selection from the line if Ctrl is pressed.