c# - Refresh Bound Datagridview -


I have seen so many examples on how to do this and I can do this but it displays the wrong data set . My point is that I have a switch board and pass this parameter using another code in the second form:

  Public Zero LoadCaseNumberKey {string} CaseNumberKey {propertyInformationTableAdapter1.FillByCaseNumberKey (newCityCollectionDataSet. PropertyInformation, CaseNumberKey); MoneyLensTable Adapter FieldBaseNumberKey (newCityConnectContactMunielians, CessnumberKey); DocumentsTableAdapter.FillByCaseNumberKey (newCityCollectionDataSet.Documents, CaseNumberKey); }   

So if I choose to use one of the many ideas in it then I get the wrong data as it refreshes the table adapter with a complete dataset.

I use to add a record as follows:

  Private Zero cmdAdd_Click (Object Sender, EventArgs E) {DataClasses1DataContext DB = New DataClasses1DataContext () ; Munialian nullion = new munialian (); Newlien.CaseNumberKey = Case digit text box. Text; Db.MuniLiens.InsertOnSubmit (newlien); Db.SubmitChanges (); This.muniLiensDataGridView.EndEdit (); This.muniLiensDataGridView.Refresh (); }   

What would be the best way to refresh the datagrid view? This is the code that refreshes it, but with the whole set of datasets in contrast to the correct set:

  this.muniLiensTableAdapter.Fill (this.CityDataSet.muniLiens);   

Example:

  Private Zero LoadCaseNumberKey (string CaseNumberKey) {// // your stuff to datagrid Loading} Private Zero cmdAdd_Click (Object Sender, EventArgs E) {DataClasses1DataContext DB = New DataClasses1DataContext (); Munialian nullion = new munialian (); Newlien.CaseNumberKey = Case digit text box. Text; Db.MuniLiens.InsertOnSubmit (newlien); Db.SubmitChanges (); This.muniLiensDataGridView.EndEdit (); This.muniLiensDataGridView.Refresh (); // Add it if this data grid is bound - & gt; & Gt; LoadCaseNumberKey (string CaseNumberKey) or // LoadData (); }   

Regards

Comments