private void View_CellClick(object sender, DataGridViewCellEventArgs e) { try { DataGridViewRow dr = View.Rows[e.RowIndex]; Object data = dr.DataBoundItem; Entity.Employee emp = (Entity.Employee)data; New_Emp view = new New_Emp(emp, "Detail", this); view.Location = new Point(20, 20); view.Visible = true; }catch (Exception E) { } }
private void button1_Click(object sender, EventArgs e) { New_Emp view = new New_Emp("Add", this); view.Visible = true; }