icollectionview

WPF ICollectionView Filtering

Hi ! I've written a code for filtering items in ComboBox: My question is, how would you do that? I think that this solution with reflection could be very slow.. ICollectionView view = CollectionViewSource.GetDefaultView(newValue); view.Filter += this.FilterPredicate; private bool FilterPredicate(object value) { if (...

Finding all the ICollectionView's attached to a collection

We have multiple filters based on the same collection. i.e. we are displaying the same collection in a variety of ways. What i would like to be able to do is ask all of the CollectionViews to refresh when a property changes (as the collection view will only refilter if items get added/removed from the collection). Is there a way to find ...

Create a View of a View in WPF

OK, so I need to create an ICollectionView from an existing ICollectionView. The idea is that I can take whatever filters/grouping/sorting has been set on the existing view and then create other views from that "base" view, in effect "layering" or aggregating my filters, etc. I need the end view to update its items "auto-magically" wh...

ICollectionView.SortDescriptions sort does not work if underlying DataTable has zero rows

We have a WPF app that has a DataGrid inside a ListView. private DataTable table_; We do a bunch or dynamic column generation ( depending on the report we are showing ) We then do the a query and fill the DataTable row by row, this query may or may not have data.( not the problem, an empty grid is expected ) We set the ListView's It...

ICollectionView Sorting issue in ListView

I saw ICollectionView being introduced with WPF to handle situations when you need sorting and filtering enabled. I even saw few articles which sort items, but my main concern is why my approach is failing. Lets see my code : <ListView ItemsSource="{Binding}" x:Name="lvItems" GridViewColumnHeader.Click="ListView_Click"> <L...

What is the type of object added by IEditableCollectionView?

Adding objects with the IEditableCollectionView addNew() method is pretty decent. However I'm not sure how well it works with my generic code I have. I have a ObservableCollection of my base class. Depending on what the user wants to see it can be filled with DerivedA or DerivedB ( or mutliple other derived type classes ). It never has ...

Re-establishing WPF databinding after changing property value

I'm playing with ICollectionView right now, and am encountering a problem where I think I understand the "why", but not the "how do I fix it". :) I have a ComboBox that's databound to an ICollectionView, and it is initially set with the following code: NameView = CollectionViewSource.GetDefaultView( names); // names is an IEnumerable<...