I have a ListView bound to a collection of items. I do not want to show the items where the property IsDeleted = "1". How can I accomplish this?
I'd use a CollectionView and set the Filter property to an expression:
var view = CollectionViewSource.GetDefault(GetData());
view.Filter = i => ((MyType)i).IsDeleted != 1;
MyListView.DataSource = view;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With