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

WPF Multiple CollectionView with different filters on same collection

I'm using a an ObservableCollection with two ICollectionView for different filters. One is for filtering messages by some type, and one is for counting checked messages. As you can see message filter and message count works OK, but when I'm…
drtf
  • 1,886
  • 2
  • 21
  • 19
26
votes
4 answers

Fast performing and thread safe observable collection

ObservableCollections raise notifications for each action performed on them. Firstly they dont have bulk add or remove calls, secondly they are not thread safe. Doesn't this make them slower? Cant we have a faster alternative? Some say…
user778654
21
votes
7 answers

how to sort ObservableCollection

I have a an ObservableCollection and a WPF UserControl is Databound to it. The Control is a graph that shows a vertical bar for each item of type BarData in the ObservableCollection. ObservableCollection class BarData { public DateTime…
Souvik Basu
  • 3,069
  • 4
  • 28
  • 42
19
votes
2 answers

Automatically refresh ICollectionView Filter

Is there any way to automatically update a filter on an ICollectionView without having to call Refresh() when a relevant change has been made? I have the following: [Notify] public ICollectionView Workers { get; set; } The [Notify] attribute in…
Jason D
  • 2,634
  • 6
  • 33
  • 67
16
votes
4 answers

Convert ICollectionView to List

I am binding property type of ICollectionView on DataGrid controls in WPF, .NET 4.0. I use Filter on ICollectionView. public ICollectionView CallsView { get { return _callsView; } set { …
user572844
15
votes
3 answers

Implementing ICollectionViewLiveShaping

How is ICollectionViewLiveShaping implemented for the purpose of filtering? Is it something like: public ICollectionView WorkersEmployed { get; set; } WorkersEmployed = new CollectionViewSource { Source = GameContainer.Game.Workers }.View; I'm not…
Jason D
  • 2,634
  • 6
  • 33
  • 67
13
votes
3 answers

Wpf ICollectionView Binding item cannot resolve property of type object

I have bound a GridView with an ICollectionView in the XAML designer the properties are not known because the entity in the CollectionView have been transformed into type Object and the entity properties can't be accessed, it runs fine no error but…
ramon22
  • 3,528
  • 2
  • 35
  • 48
11
votes
2 answers

CollectionView.DeferRefresh() throws exception

There are cases when you have many UI updates due a massive amount of INotifyChangedProperties events. In that case you might want to signal the changes to UI only once when all the properties are set like in a batch. I found this great article that…
Houman
  • 64,245
  • 87
  • 278
  • 460
10
votes
9 answers

Arrow keys don't work after programmatically setting ListView.SelectedItem

I have a WPF ListView control, ItemsSource is set to an ICollectionView created this way: var collectionView = System.Windows.Data.CollectionViewSource.GetDefaultView(observableCollection); this.listView1.ItemsSource = collectionView; ...where…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
9
votes
1 answer

What are the differences between CollectionViewSource, ICollectionView, ListCollectionView, IList and BindingListCollectionView and their use cases?

What are the differences between CollectionViewSource, ICollectionView, ListCollectionView, IList and BindingListCollectionView? When and where to use all these collections? I know the main use of CollectionViewSource, but I'm not clear with when to…
Selva
  • 1,310
  • 2
  • 14
  • 31
8
votes
2 answers

Why sorting using CollectionViewSource.SortDescriptions is slow?

This is the default sort method when you click on a column header in a DataGrid. When the underlying list contains 100,000 items, it takes about 20 seconds to refresh the view. Same delay can be observed when setting SortDescriptions on a…
Sergey Aldoukhov
  • 22,316
  • 18
  • 72
  • 99
7
votes
3 answers

Convert Predicate to Expression>

Is possible to convert a Predicate to Expression> in some way? I would like to use the next IQueryable function using the filters of the my ICollectionView: public static System.Linq.IQueryable Where(this…
7
votes
3 answers

How to associate custom data with a CollectionViewGroup?

I've got an ItemsControl in XAML where I am displaying an expander for each group so I can expand/collapse the group. I want to persist the state of the IsExpanded property (and potentially other settings relating to the display of the group…
6
votes
3 answers

How to bind to CurrentItem of ICollectionView

I want to a property to the current item of a ICollectionView how can I do it? The ICollectionView is used for binding to a combo box, how can I bind another control to the ICollectionView's selected item?
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
6
votes
1 answer

async CollectionViewSource filtering?

I got really big ObservableCollection and I need to provide user-friendly filtering on it. public static async Task RefilterViewAsync(this ItemsControl @this, Predicate compareLogic) { await Task.Run( () => { …
52hertz
  • 342
  • 4
  • 16
1
2 3
8 9