// Form1 Code
public void UpDateData(DataTable dt)
{
dataGridView1.Refresh();
dataGridView1.DataSource = dt;
updateTextBoxes();
}
public void updateTextBoxes()
{
// Some caluculation based on the datagridview rows
}
Form2 Button click code
private void button1_Click(object sender, EventArgs e)
{
// Some code to collect the changes made
Form1 f=new Form1();
f.UpDateData(lDTGet);
}
Every thing works fine except the updateTextBoxes method this is not updating the textboxes as per required can some one help me


VulpesRank #55 · 29.2K reputationPosted Jun 24, 2013, 2:53 AM EDT
I'd try replacing this line:
Form1 f=new Form1();
with:
Form1 f = (Form1)Application.OpenForms["Form1"];
Pankaj PandeyRank #642 · 3.7K reputationPosted Jun 24, 2013, 2:54 AM EDT
public void updateTextBoxes()
{
.//your code here
Application.DoEvents();
}