c# - Gridview Update -


when gridview data update in other forms data update when close form gridview data refresh not response automatically in c# win-forms application here code:

private void button1_click(object sender, eventargs e) {     acatagory=new tbl_catagory();     acontext = new rm_inventory_datacontext();      var product = (from p in acontext.tbl_catagories                    p.catagoriesid == convert.todecimal(textbox1.text)                     select p).single();      product.catagoriesname = textbox2.text;      acontext.submitchanges();     this.close();     addcatagories addcatagories=new addcatagories();     addcatagories.gridview(); }   public void gridview() {     gridcontrol1.datasource = new rm_pm_inverntory_management_system.rm_inventory_datacontext().tbl_catagories; } 

you not binding gridview after assigning datasource.

public void gridview() { gridcontrol1.datasource = ever data source have gridcontrol1.databind(); } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -