Why am I getting Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.ObjectModel.ObservableCollection'


i trying filter out collection this;

mycollection = mycollection.where(x => x.mydata.indexof(mystring) > -1);

although giving me error;

cannot implicitly convert type 'system.collections.generic.ienumerable' 'system.collections.objectmodel.observablecollection'. explicit conversion exists (are missing cast?)

thanks

if 'mycollection' observablecollection try following:

var result = mycollection.where(x => x.mydata.indexof(mystring) > -1).tolist();
mycollection = new observablecollection<yourtype>(result);

wizend



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user