Hi,
I'm trying to use the solution Riku presented, but the DefaultView is never getting updated with the filter information:
public
ICollectionView WellPropertyCollection
{
get
{
if
(_WellPropertyCollection ==
null
&& WellProperties !=
null
)
{
// This works fine
//_WellPropertyCollection = new QueryableCollectionView(WellProperties);
// This always contains the full collection, and _WellPropertyCollection.Filter is null.
_WellPropertyCollection = CollectionViewSource.GetDefaultView(WellProperties);
// Tried this as well as a desperate measure, but this didn't work either.
//CollectionViewSource newSource = new CollectionViewSource();
//newSource.Source = WellProperties;
//_WellPropertyCollection = newSource.View;
}
return
_WellPropertyCollection;
}
}
If I use the QueryableCollectionView wrapper, then the list correctly contains the filtered items after a filter is applied. However, using the DefaultView, the list always contains all the items in the full list and the Filter property on the ICollectionView is never set.
Am I doing something wrong here? How can I get the filtered list in the ViewModel without introducing view-specific (Telerik) classes?
Thanks,
Louis