SelectionChanged methods are triggered when the selection is changed by program. So, for example, calling dataGridView.ClearSelection()
or dataGridView.Rows[0].Selected = true
would call the method
private void dataGridView_SelectionChanged(object sender, EventArgs e)
{
}
Is it possible to execute code only when the user changed the selection, e.g. by selecting a row/cell with the mouse or keyboard?