dataset - Refresh a dataview grid in c# -
i have form datagridview item views table databse. form adds new row table , closes self. in first form, @ closing event of second form, want first form update/refresh/refill new data added. have tried this:
this.swimmerstableadapter.update(this.databasedataset1.swimmers);
and:
this.update();
but unsuccessfully.
it refresh self when stop debugging, , run again, ofcource it's not practical client/user.
any solutions ?
probably need this...
form 1:
public partial class form1 : form { public form1() { //'add label , buttom form initializecomponent(); } private void button1_click(object sender, eventargs e) { form2 frm2 = new form2(this); frm2.show(); } public void refreshgrid() { datagridview1.update(); } }
form 2:
public class form2 : form { form1 _frm1; public form2(form1 frm1) { _frm1 = frm1; this.formclosing += form2_formclosing; } private void form2_formclosing(object sender, formclosingeventargs e) { _frm1.refreshgrid(); } }
Comments
Post a Comment