Calling a detail data form from a DataGrid row

Hey all,

This is probably a very simple thing to do, but I have searched far and wide and cannot find out how to do it :p, I am quite new to VS and C#, but have done some C++ programming in the past.

My question is this. I have a nice little form with a a DataGridView, and I want to know how to make it so the user clicks on a row of the grid, and it opens another form in Detail data view. I don't know if this is a master / detail situation since it is the same table, just with a different form.

Any help would be appreciated!!! Thank you very much!


Answer this question

Calling a detail data form from a DataGrid row

  • KrazyKiwi

    Thank you! I have tried it, and have built the constructor, but I get a compile error on this line:

    string strRef = dgvTest.Rows[e.RowIndex].Cells[0].Value.ToString(); // Read the master key

    The compiler says that my form (dgvTest) does not contain a definition for Rows. Also, I could not find the _CellMouseDoubleClick event, and had to use the standard DataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)


  • Joe Au

    T

  • Calling a detail data form from a DataGrid row