Hello,
i tried to bind a DataGrid in TwoWay Mode to a WCF Service. The Data get displayed but changes in DataGrid dont affect the Database, from which the WCF Service is getting the data.
I hope someone can help me... Thank you.
My Szenario:
I have a WCF Service which offers exactly one Function which return a custom class. The custom class inherits from INotifyPropertyChanged and has only one DataMember, an ObservableList with my DB Entitys.
//Service.svc.cs
static testdatenEntities _context = null;
private static testdatenEntities Get_context()
{
if (_context == null)
{
_context = new testdatenEntities();
}
return _context;
}
public customData GetDataFromADO()
{
var _context = Get_context();
var result = (from lief in _context.LIEF_INFO.AsQueryable()
orderby lief.LNR
select lief).Skip(50).Take(50);
ObservableCollection<LIEF_INFO> _ocol = new ObservableCollection<LIEF_INFO>(result);
customData customdata = new customData() { List = _ocol };
return customdata;
}
//IService.cs
[DataContract]
public class customData : INotifyPropertyChanged
{
ObservableCollection<LIEF_INFO> _ocol = new ObservableCollection<LIEF_INFO>();
[DataMember]
public ObservableCollection<LIEF_INFO> List
{
View Complete Post