DataGridView: No selection mode (Forms)

To prevent selection in a DataGridView add the SelectionChanged event

private void dataGridView_SelectionChanged(object sender, EventArgs e)
{
	//Just to be sure this will not become recursive 
	if (dataGridView.SelectedRows.Count > 0) dataGridView.ClearSelection();  
}
Lastest update in February 2021, inital post in September 2017

Write a comment

I appreciate comments, suggestions, compliments etc. Unfortunately I have no time to reply to them. Useful input will be used for sure!