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