Reputation: 533
I have a GridView in my form (FORM 1), I want when I double click on some record in it to show me all the reocrd informations in another form (FORM 2).
this is the code I use to get a dataRow from the gridView when I double click on it:
private void gridControl1_DoubleClick(object sender, EventArgs e)
{
DataRow row = gridView1.GetDataRow(gridView1.GetSelectedRows()[0]);
}
But I don't know how can I display the row information in another form (FORM 2).
Form1 :
Form2 :
Upvotes: 0
Views: 1523
Reputation: 359
I dont think so, it is good idea make form constructor parametrized, sometimes it brings troubles
Form2 frm = new Form2();
frm.SourceRow = gridView1.GetDataRow(gridView1.GetSelectedRows()[0]);
frm.Show();
Upvotes: 0
Reputation: 75609
Basically:
DataRow row = gridView1.GetDataRow(gridView1.GetSelectedRows()[0]);
Form2 frm = new Form2(row);
frm.Show();
Upvotes: 3