private void editButton_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count != 0) { this.Enabled = false; RegForm reg = new RegForm(); reg.IsEditMode = true; reg.UserID = (int)dataGridView1.SelectedRows[0].Cells["ID_Employee"].Value; reg.FillFieldsWithData(dataGridView1.SelectedRows[0]); reg.Show(this); } }