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
2
votes
4 answers

Filter a collection multiple times using ICollectionView

I'm trying to filter an ObservableCollection that is displayed in a DataGrid. This works great the first time, but when I try to filter again, it uses the sourcecollection instead of the filtered result. Short code example: ICollectionView view =…
Bram W.
  • 1,587
  • 4
  • 16
  • 39
2
votes
1 answer

Create a filtered view of an observablecollection and display it in listbox

I have a ObservableCollection that contains data from a database using Linq. I need to only have specific filtered items of that collection to be shown in my listbox. I have created a ICollectionView which i initialized as the default view from that…
hypestar
  • 39
  • 1
  • 9
2
votes
1 answer

WPF Prism 4 Unit Testing

I have been using Prism 4 to create a composite wpf application, now I want to begin to test the app. using unit testing and moq, I have worked trough the StockTrader RI sample and tried to build my application as close to the RI implementation as i…
noobieq
  • 21
  • 2
2
votes
2 answers

ICollectionView for Silverlight and WPF

Does anyone know if there is a common object that inherits from ICollectionView in both Silverlight and WPF? Or do I just have to create my own version?
Matthew Bill
  • 203
  • 3
  • 11
2
votes
1 answer

Grouping listviews in wpf

In a UWP app, I can set a CollectionViewSource's Source to a List and it will group it right off the bat. With WPF it seems to work differently. I want to be able to group my list in code behind and just feed it the collection instead of listview…
shady
  • 1,076
  • 2
  • 13
  • 33
2
votes
1 answer

Filter child items of objects in ICollectionView

I have a a collectoin of an object called ItemType, each of which has a child collection of Item. The top level collection is wrapped into an ObservableCollection so it responds when users add or remove things from the collection. This is bound to a…
Bob Tway
  • 9,301
  • 17
  • 80
  • 162
2
votes
0 answers

Design confusion with ViewModel, Model and CollectionView

This question relates to design help. In it I present a problem, and some solutions I thought of, together with my opinions of the solutions; and finally a solution I think is the correct one. I am seeking validation or challenges to my solutions.…
2
votes
2 answers

Sorting ObservableCollection with ICollectionView does't work correctly

To generate the bug, select any item in TopDataGrid. As a result, the collection of items will be loaded into BottomDataGrid. This collection is sorted by Name property as I specified! Then select any other item in the TopDataGrid. The result is…
monstr
  • 1,680
  • 1
  • 25
  • 44
2
votes
1 answer

CollectionView not populated?

I've used ICollectionView a few times and never had any problems... but I can't get this one to work. In my constructor I do the following: _viewModels = new ObservableCollection(); var icv =…
Nicros
  • 5,031
  • 12
  • 57
  • 101
2
votes
1 answer

Filtering ObserverableCollection to display only certain items

I was following this link here: http://jacobmsaylor.com/?p=1270 but i'm having problems with it, trying to make tweaks to it
user1189352
  • 3,628
  • 12
  • 50
  • 90
2
votes
1 answer

WPF ObservableCollection CollectionView.CurrentChanged not firing

I have a problem with one of my ICollectionViews. The ICollectionView's CurrentChanged event is not firing. Please see my code below. XAML:
ELM
  • 21
  • 1
  • 3
2
votes
1 answer

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…
Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
2
votes
1 answer

ICollectionView filter not being called

I created a small User Control, that contains a ICollectionView and a ObservableCollection. ObservableCollection messages; public ObservableCollection Messages { get { return messages; } } ICollectionView log; public…
ChrisK
  • 1,216
  • 8
  • 22
2
votes
5 answers

How to keep the current sort of a ICollection after data refresh?

I've a problem in my application Client/Server. I work with the MVVM pattern. In my view, I've a DataGrid which is bound with a ICollection in my ViewModel with these lines of code : public ICollectionView Customers { get { …
2
votes
2 answers

ICollectionView keyboard index resets on Refresh

I am using an ICollectionView to display a list of items within a ListView. I have come across an issue I do not seem to be able to find a solution for. The selection works fine as long as one only uses the mouse. To always display the up to date…
Thomas Huber
  • 1,282
  • 1
  • 13
  • 23
1 2
3
8 9