使用DevExpress为控件CheckedListBoxControl绑定DataSource时,引发异常“ NotImplementedException 未实现该方法或操作”,代码如下:
1
2
3
|
this .checkedListBoxControl.DataSource = DataAccess.BaseInfoDataAccess.Sites.Where(v => v.Site==1); this .checkedListBoxControl.ValueMember = "Site" ; this .checkedListBoxControl.DisplayMember = "SiteName" ; |
在Where后加上ToList()后,解决。
1
|
this .checkedListBoxControl.DataSource = DataAccess.BaseInfoDataAccess.Sites.Where(v => v.Site==1).ToList(); |