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
Post a Comment