winforms - Update datagrid view with updated data -
i've datagridview. read xml file , bind data gridview. change xml , save in form. reread xml file , bind gridview. datatable getting updated values. grid not getting updated till close , open application again. how it?
thank you.
regards, raghavendra
#1
is there databind() or rebind() datagridview? set datasource -
dvmovieslist.datasource = dtmovies;
if add new row dtmovies table , set datasource again, getting reflected. if edit values of of existing rows , re assign datasource not getting reflected till close , open application again. ideas?
thank you.
i think need place bindingsource in between datagridview , datatable.
datagridview _dgv = new datagridview(); bindingsource _bs = new bindingsource(); datatable _dt = new datatable(); . . . _dgv.datasource = _bs; _bs.datasource = _dt;
now whenever _dt
gets updated, bindingsource should take care of refreshing datagridview , shouldn't have worry resetting datasource property. datasource properties can set in initializecomponent()
method (the designer), form's constructor, or form.load event handler.
Comments
Post a Comment