Questions tagged [icollectionview]

An interface that enables collections to have the functionalities of current record management, custom sorting, filtering, and grouping.

The ICollectionView Interface, available in .NET 3+, enables collections to have the functionalities of current record management, custom sorting, filtering, and grouping.

http://msdn.microsoft.com/en-us/library/system.componentmodel.icollectionview.aspx

135 questions
5
votes
2 answers

Removing item from ICollectionView

How can I remove item from ICollectionView in c#? Dictionary entityDict; public ICollectionView DictView { get; set; } dictView = CollectionViewSource.GetDefaultView(entityDict.Values); dictView.//No remove method Thanks
Igal
  • 1,084
  • 2
  • 13
  • 33
5
votes
1 answer

WPF ICollectionView Filtering

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 +=…
theSpyCry
  • 12,073
  • 28
  • 96
  • 152
5
votes
2 answers

WPF Binding filtered ObservableCollection ICollectionView to Combobox

I want to filter an ObservableCollection to a subset based on type (type AddPoint) and want it ordered ascending with no duplicates. My base class is ModelBase, w/ sub-classes AddPoint, Time, Repeat, etc... The ObservableCollection…
4
votes
1 answer

How to select first item after filtering ICollectionView

I'm binding a ListView to an ICollectionView in my viewmodel. The ICollectionView has some predefined filters that are applied when you click some buttons. However I cannot seem to find any way to (auto) select the first item in the ListView after…
Werner
  • 1,229
  • 1
  • 10
  • 24
4
votes
1 answer

LiveFiltering on ListCollectionView doesn't reevaluate the Filter when a property of an item in the list changes

I have a class Person, which implements INotifyPropertyChanged for the property Name: public class Person : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string property) …
Michael
  • 386
  • 2
  • 9
4
votes
1 answer

wpf collectionview multiple filter

I need some advice. I have two ListViews first ListView is "ListViewAlbums" and the second "ListViewTracks".   Items in ListViewTracks are organized into groups. ListViewAlbums is set SelectionMode = "Extended" and Behaviours:…
user6473719
4
votes
1 answer

Datagrid with ICollectionView SortDescription got lost - Bug?

here is what i want: if i bind a ICollectionview to a DataGrid, i dont wanna loose the SortDescription in my Viewmodel. i create a small sample project to see what i mean. In my projects i simply use a Usercontrol to show my data in a DataGrid. If i…
blindmeis
  • 22,175
  • 7
  • 55
  • 74
3
votes
3 answers

wpf datagrid icollectionview sorting BUG?

maybe someone can help me? I have the following scenario: A simple view:
Daniel Bişar
  • 2,663
  • 7
  • 32
  • 54
3
votes
1 answer

ICollectionView Sort doesn't work after changing source

I have a method that queries a database using entity framework and places the results in an ICollectionView. The ICollectionView acts as the ItemsSource for a DataGrid. Everything works fine on the first query, but upon querying a second time, the…
matthew_b
  • 739
  • 1
  • 7
  • 18
3
votes
1 answer

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…
3
votes
3 answers

ObservableCollection doesn't sort newly added items

I have the following ObservableCollection that's bound to a DataGrid: public ObservableCollection Messages = new ObservableCollection; XAML: I sort it on startup, using default…
Eternal21
  • 4,190
  • 2
  • 48
  • 63
3
votes
1 answer

sort and group Icollectionview in WPF

I have created a listview control in WPF and has success fully bound Icollectionview object of ObservableCollection. My listview columns are created dynamically. I have to sort and group my listview and it is not working properly. My code is…
Dinu
  • 123
  • 1
  • 2
  • 7
3
votes
1 answer

Why is not ICollectionView refreshed?

I cant figureout why my ICollectionView is not refreshed. Can anyone explain what I'm doing wrong? I've made a viewmodel like this: class ViewModel : INotifyPropertyChanged { private ObservableCollection m_entities = new…
Erik Z
  • 4,660
  • 6
  • 47
  • 74
2
votes
1 answer

Filtering two ICollectionView from a single ObservableCollection

I have a problem using two ICollectionView instances that have the same ObservableCollection as source. When I filter an ICollectionView, it seems that also the other ICollectionView is filtered with the same filter. I instantiate the…
Giacomo Tagliabue
  • 1,679
  • 2
  • 15
  • 31
2
votes
1 answer

ICollectionView.Refresh doesn't refilter the collection

I have 3 cascading ICollectionViews in my view model where one relies on the other. The first one, isn't bound to a control on the view but is rather used as a key-filter for the two upcoming ones that are displayed to user as master-detail. My…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
1
2
3
8 9