Form1 NewPage has a datagridview and two buttons AddEntry and EditEntry.Form2 AddEntry has 6 textboxes and ok button. When i click on AddEntry button,form2 will open.When i enter some data in textboxes and then click ok,it has to add to datagridview of form1.
I've written this code behind AddEntry Button.I'm now able to get data from textboxes.
public void AddEntryBtn_Click(object sender, EventArgs e) { string x = label4.Text; using (var obj_Addentry = new AddEntry(x)) { obj_Addentry.ShowDialog(); } this.Close(); }
When i click EditEntry button the row selected data will be appearing in the textboxes to edit.but the problem is,When i click ok button in form2,nothing is done as i've no code for adding the data to datagridview behind ok button of form2.Code for adding the data to datagridview is behind AddEntry button of form1.
What should i write for adding the data to datagrid view behind ok button of form2 instead of writing it behind AddEntry button of form1?
Aucun commentaire:
Enregistrer un commentaire