c# - changing textblock to textbox loses data bindings - -
This is a wpf / c # app - I have a grid where I used the text box and the data binding is fine Was there. I later created another grid using text blocks. Both worked well but when I changed the text boxes in the second grid in the text, all stopped showing the same data.
I have copied both C # LINQ code and XAML code, which provide data for binding, recompiled, closed for Notepad saved ++, and VS (8) . After reopening the project, I started the code again, but I still do not get any data.
Any ideas that will help, will be greatly appreciated.
DBC.Wonders have # code from V
var vendDetail = where v.vendorID == select new sale {v.Address1, v.Address2, CSZ = V.City + "," + v.State + "" + v.zip, v.phone, v.fax, v.contact, v.Terms, v.email}; GrVendorData.DataContext = vendDetail;
and XML code:
& lt; Text box x: name = "txtVendorAddr1" text = "{binding path = address1}" background = "alisblue" grid. Rau = "2" grid. Column = "1" /> & Lt; Text box x: name = "txtVendorAddr2" text = "{binding path = address 2}" grid Line = "3" grid. Column = "1" background = "Alice Blue" /> & Lt; Label content = "city" grid. Line = "4" grid Column = "0" /> & Lt; Text Box X: Name = "txtVendorCity" text = "{Binding Path = CSZ}" Grid Line = "4" grid Column = "1" /> & Lt; Label content = "Phone" grid. Line = "1" grid. Column = "0" /> & Lt; Text box x: name = "txtVendorPhone" text = "{binding path = phone}" grid. Line = "1" grid. Column = "1" /> & Lt; Label content = "fax" grid. Column = "2" /> & Lt; Text box text = "{binding path = fax}" grid. Line = "0" grid Column = "3" /> & Lt; Label Content = "Terms" Grid Line = "2" grid Column = "2" /> & Lt; Text box text = "{binding path = terms}" grid. Line = "2" grid Column = "3" /> & Lt; Label content = "notes" grid. Rau = "3" grid. Column = "2" /> & Lt; Text box text = "{binding path = notes}" grid. Rau = "3" grid. Column = "3" grid. Rowspan = "2" textwapping = "wrap with overflow" /> & Lt; Label content = "email" grid Line = "1" grid. Column = "2" /> & Lt; Text box text = "{binding path = email}" grid. Line = "1" grid. Column = "3" />
You can not divide into anonymous types, that's why your selection After starting the binding work complete record
Comments
Post a Comment