I want to get all the places which are active for bid. I tries this but I'm getting null.
testObservableList = testObservableList.Where(
x => x.IsActiveForBid) as ObservableCollection<Places>;
I want to get all the places which are active for bid. I tries this but I'm getting null.
testObservableList = testObservableList.Where(
x => x.IsActiveForBid) as ObservableCollection<Places>;
try this.
testObservableList =
new ObservableCollection(testObservableList.Where(x => x.IsActiveForBid));
This will make a shallow copy of the current IEnumerable and turn it in to a ObservableCollection
While an ObservableCollection<T>
is IEnumerable<T>
the opposite does not hold. Try a constructor:
new ObservableCollection<SometypeType>(
testObservableList.Where(x => x.IsActiveForBid))
Try this:
ObservableCollection coll1 = new ObservableCollection(testObservableList.Where(x => x.IsActiveForBid);
I guess this will do it.