Sunday 15 February 2015

wpf - Update datatable when changed data in the datagrid -


I am new to WPF and for several days I can not find the answer to my question. Please, to tell me useful links ...

I have a figure which is bound to the datagrid.

  Public class customers: INotifyPropertyChanged Private DataTable _contacts; Public datatable contact {receive {return_contact; } Set {_contacts = value; OnPropertyChanged ("Contact"); }} Public Client () {RaisePropertyChanged ("Contact"); } Private Event PropertyChangedEventHandler PropertyChanged; Public Zero OnPropertyChanged (string propertyName) {If (PropertyChanged! = Null) {PropertyChanged (New, PropertyChangedEventArgs (propertyName)); }} Public Zero RaisePropertyChanged (string propertyName) {if (this.PropertyChanged! = Null) this.PropertyChanged (this, New PropertyChangedEventArgs (propertyName)); If (string.Comparare (propertyName, "Contact") == 0) {var Customer Contacts = New Customer Resources (); If (ID! = Zero) customer contact GetTableByCustomerId (ID); Contact = customer contact; // .. There is logic for other properties ..}}   

And here's xaml:

   & Lt; DataGridTextColumnBinding = "{Binding Delano, Notification UpdateData = True}" clipboard contentbing = "{x: faucet}" /> & Lt; /DataGrid.Columns> & Lt; / Data grid & gt;   

I do not know how to implement data updates in the database is better I have to get two lists of specified dotaries: List with updated rows (inside new rows inside) And with the deleted lines, I want to work with the whole line, not with cells. And I do not use DataTableAdapter. Any changes in the datagrid no longer provide updates to the source archive. What would be better to use (OnTargetUpdated, RowEditEnding etc.)? Please do not beat me so much thanks in advance!

I think it incorporates a datagread to improve auditable data instead of data tab. Or have been deleted.

In the link below the solution adopted to resolve this kind of problem, though besides this I also needed to update the values ​​of the properties of the binded objects. I hope it Helps ...

Oscars

No comments:

Post a Comment