Questions tagged [collectionviewsource]

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

377 questions
60
votes
3 answers

Proper way to use CollectionViewSource in ViewModel

I used Drag and Drop to bind Data Source object (a DB model) to DataGrid (basically following this example in Entity Framework Databinding with WPF. Everything works fine with this implementation. XAML
David S
  • 723
  • 1
  • 6
  • 7
54
votes
6 answers

Trigger Filter on CollectionViewSource

I am working on a WPF desktop application using the MVVM pattern. I am trying to filter some items out of a ListView based on the text typed in a TextBox. I want the ListView items to be filtered as I change the text. I want to know how to trigger…
Pieter Müller
  • 4,573
  • 6
  • 38
  • 54
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
48
votes
2 answers

Grouping items in a ComboBox

I have a ListView that contains two types of objects, single and multiple. The single is a ordinary TextBlock while the multiple is a ComboBox with items. I'm trying to group the items in the ComboBox without success. Is it possible? Or should I go…
debe
  • 608
  • 1
  • 5
  • 13
34
votes
5 answers

Re-sort WPF DataGrid after bounded Data has changed

I am looking for a way to re-sort my DataGrid when the underlying data has changed. (The setting is quite standard: The DataGrid's ItemSource property is bound to an ObservableCollection; The columns are DataGridTextColumns; The data inside the…
marc wellman
  • 5,808
  • 5
  • 32
  • 59
20
votes
3 answers

CollectionViewSource sorting only the first time it is bound to a source

I'm using a DataGrid bound to a CollectionViewSource (players), itself bound to the currently selected item of a ListBox (levels), each item containing a collection to be sorted/displayed in the DataGrid:
RedGlyph
  • 11,309
  • 6
  • 37
  • 49
20
votes
1 answer

CollectionViewSource Use Question

I am trying to do a basic use of CollectionViewSource and I must be missing something because it is just not working. Here is my XAML:
Vaccano
  • 78,325
  • 149
  • 468
  • 850
19
votes
2 answers

WPF CollectionViewSource Multiple Views?

I've written a Custom WPF Control with search extension, let's name it MyControl. The Control is a descendent of an ItemsControl class. So I feed the the data source to it like this: The control itself uses protected override void…
theSpyCry
  • 12,073
  • 28
  • 96
  • 152
18
votes
4 answers

In WPF can you filter a CollectionViewSource without code behind?

Really the subject says it all. It's not that I can't have code behind. It just nags at me.
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
18
votes
6 answers

How to get Items count from CollectionViewSource?

I am using CollectionViewSource to filter the records displayed in a ListBox. The xaml follows.
Manish Basantani
  • 16,931
  • 22
  • 71
  • 103
18
votes
10 answers

WPF DataGrid CustomSort for each Column

I have a WPF DataGrid bound to a CollectionViewSource that encapsulates an ObservableCollection. This CollectionViewSource has two main objectives: 1) To group each item by a specific property of T. I'm using a ValueConverter in the GroupDescription…
trilson86
  • 939
  • 1
  • 9
  • 20
15
votes
4 answers

How to preserve TwoWay binding of CurrentItem when databinding to CollectionViewSource in ComboBox

Lets say we got a simple VM class public class PersonViewModel : Observable { private Person m_Person= new Person("Mike", "Smith"); private readonly ObservableCollection m_AvailablePersons = new…
Valentin Kuzub
  • 11,703
  • 7
  • 56
  • 93
15
votes
3 answers

DesignTime data not showing in Blend when bound against CollectionViewSource

I have a datatemplate for a viewmodel where an itemscontrol is bound against a CollectionViewSource (to enable sorting in xaml).
bitbonk
  • 48,890
  • 37
  • 186
  • 278
14
votes
1 answer

CollectionViewSource with custom sort

I'm new to WPF and I'm having difficulty trying to sort a CollectionViewSource with a custom sort. Here's the situation: I have a SearchView that is called with a parameter which becomes it's datacontext like so: mainView.SetGlobalOverlay(New…
SimCity
  • 539
  • 3
  • 8
  • 18
13
votes
3 answers

Binding a CollectionViewSource within a DataTemplate

'ContentTemplate' is a DataTemplate that displays an object which has a member 'FooList' (an ObservableCollection). ... I…
AnthonyW
  • 131
  • 1
  • 4
1
2 3
25 26