Ok, i have 2 forms. form8 contains the datagrid view. the second(form10) form contains a textbox, and a picturebox. This is the code i am trying to use to pass the data, but it will not work.
Form8 frm8;
public Form10(Form8 frm8): this()
{
this.frm8 = frm8;
}
private void buttonX1_Click(object sender, EventArgs e)
{
try
{
int n = frm8.dataGridView1.Rows.Add();
frm8.dataGridView1.Rows[n].Cells[0].Value = textBox1.Text;
frm8.dataGridView1.Rows[n].Cells[1].Value = comboBox1.Text + "|" + textBox3.Text;
frm8.dataGridView1.Rows[n].Cells[2].Value = pictureBox1.Image;
this.Close();
}
catch { }
}
Please try to refresh the form to get the result.
or try Application.DoEvents() to get UI thread to refresh.