2
Answers

Update textboxes in Form1 on updating the datagridview

Dorababu Meka

Dorababu Meka

11y
1.5k
1
Hi all I have coded where my functionality as follows, In my form1 I will have some text boxes and a datagridview where when user click on edit of the datagridview form2 will come as popup and if the user make some changes I will update the changes and rebind the datagridview this is my code

// 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

Answers (2)