private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { frmAddEmployee frm = new frmAddEmployee(); frm.EmpId = Convert.ToInt32(dataGridView1["EmpId", dataGridView1.CurrentCell.RowIndex].Value); frm.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { frmAddEmployee add1 = new frmAddEmployee(); add1.Show(); }