private void Delete_Click(object sender, EventArgs e) { try { var List = (BindingList <PersonModel>)dataGridView1.DataSource; var SelectedRow = dataGridView1.SelectedRows[0].Index; if (SelectedRow < List.Count) { List.RemoveAt(SelectedRow); mainController.SetList(List); } } catch (Exception ex) { Console.WriteLine(ex); } }