Questions tagged [collectionviewsource]

The Extensible Application Markup Language (XAML) proxy of a CollectionView class.

377 questions
2
votes
2 answers

WPF wrong binding but CollectionView still filtering

I wrote a simple code to allow filtering on my datagrid, but I made a mistake in my code. But it still work as expected. Here is what I did: Gettings the source items (from the database) Creating the ICollectionView from it Setting my custom…
fharreau
  • 2,105
  • 1
  • 23
  • 46
2
votes
3 answers

WPF - CollectionViewSource Filter event in a DataTemplate not working

I'm seeing some really weird behavior where WPF isn't doing what I expect it to do. I've managed to boil the problem down the following bit of code: XAML:
Ashley
  • 471
  • 7
  • 15
2
votes
1 answer

Binding XAML-defined CollectionViewSource to ViewModel

There's a lot of discussion about Filtering, Grouping and Sorting on CollectionViewSource in WPF, and what is an isn't "MVVM"-practical (especially when adding Filters in code-behind). I want to have ViewModel control over these properties (like…
turkinator
  • 905
  • 9
  • 25
2
votes
1 answer

CollectionViewSource Filtering Event vs Property

What are some of the practical differences between using the CollectionViewSource.View.Filter property as opposed to the CollectionViewSource.Filter event? Are there situations where you would use one over the other or is it a matter of…
Berryl
  • 12,471
  • 22
  • 98
  • 182
2
votes
2 answers

CollectionViewSource.SortDescriptions not work when binding items are created using Parallel

I'm using VS2013, .net4.5, WPF desktop application. Xaml:
Lei Yang
  • 3,970
  • 6
  • 38
  • 59
2
votes
2 answers

Grouping of items in ListView WPF

I have a ListView where I want to group the items based on a field of the item object. Below is the code I have:
tavier
  • 1,744
  • 4
  • 24
  • 53
2
votes
2 answers

Use CollectionViewSource with TabControl

I'm trying to group and display the items of an ObservableCollection, just by using XAML code. It works well using a simple CollectionViewSource and a ListBox[1]. Actually, I would prefer to display the group's content in a tabcontrol. Google led…
Bechi
  • 59
  • 12
2
votes
0 answers

Sorting a dictionary (on key) using a custom comparer for SortDescription

I have a property: ObservableDictonary ModuleConnections and have created a collection view source like so:
Vincent
  • 1,497
  • 1
  • 21
  • 44
2
votes
1 answer

Windows phone 8.1 filter collectionviewsource

In Windows phone 8 I used to filter my collectionviewsource using Filter predicate. Now in 8.1 it disappeared. How can I filter my collectionviewsource now? Or my listview? Thanks in advance
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
1 answer

CollectionViewSource unselect selectedItem when clicking a group name

I have a listbox that has its itemSource bound to a collectionViewSource that is grouped and has 2 levels of groupings over the actual items:
user1336827
  • 1,728
  • 2
  • 15
  • 30
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

Filtering an ObservableCollection to multiple list boxes

In my project I currently have an ObservableCollection that is populated inside of my ViewModel constructor. This ObservableCollection holds a custom object which has two properties (both strings). Currently, the XAML/View counterpart holds two…
sunnysesh
  • 123
  • 2
  • 13
2
votes
2 answers

Get notified of DataContext changed in a WPF Resource

I'm having an annoying problem with WPF binding. Basically, I declare a FrameworkElement in my UserControl's resources, but that item doesn't seem to get notified when the DataContext of the parent UserControl changes. Basically, in my UserControl…
dks1983
  • 165
  • 2
  • 8
2
votes
1 answer

Lazy/deferred loading of a CollectionViewSource?

When you create a CollectionViewSource in the Resources section, is the set Source loaded when the resources are initalized (i.e. when the Resources holder is inited) or when data is bound? Is there a xamly way to make a CollectionViewSource…