此论坛已关闭。感谢你的参与。
代码就三行
DomainService1 ds = new DomainService1(); dataForm1.ItemsSource = ds.Products; ds.Load(ds.GetProductsQuery());
你好,
有2种方式使Add/Remove按钮可用。
第一种是你的ItemsSource实现了IList.
第二种是你的ItemsSource实现了ICollectionView, IEnumerable, INotifyCollectionChanged, IEditableCollectionView, INotifyPropertyChanged
DomainDataSourceView采用了第2种方法,
http://jeffhandley.com/archive/2009/08/14/entitycollectionviewconverter.aspx
这里有个实现的例子。
当然你也可以使用自定义button自己写事件,直接对DomainContext.EntitySet进行增加删除。
遇到同样的问题,有没有好的解决办法!