First of all, you have to create property in
DataShowForm
to get
entityId
from main form.
Like,
private string _id;
public string Id
{
get { return _id; }
set { _id = value; }
}
Then handle
CellDoubleClick
event from main form llke:
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
empid = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
DataShowForm frm = new DataShowForm();
frm.Id = empid;
frm.Show();
}
Then, Write method to fetch data on
DataShowForm
with use of
Id
that you have clicked from another form and call it on from load event.
You don't need
RowEnter
event at all as far as this functionality is concern.