Questions tagged [collectionviewsource]

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

377 questions
4
votes
2 answers

Collection Binding on CollectionViewSource Source Property

I've a CollectionViewSource as ItemsSource of my DataGrid. In Window.Resources I have this definition: now, I would like to…
Luca Petrini
  • 1,695
  • 2
  • 28
  • 53
4
votes
1 answer

Memory Leak with CollectionViewSource.GetDefaultView() in WPF?

I'm wondering what the best practices are for working with CollectionViews in WPF in particular the use of the CollectionViewSource.GetDefaultView() method. Has anyone run into any problems with using GetDefaultView? We're concerned that it may be…
4
votes
3 answers

"Object reference not set to an instance of an object" in PresentationFramework with Live Shaping

I'm getting a null reference in the PresentationFramework on my LifeShaping filtering: The stack trace isn't giving me much clue: at System.Windows.Data.ListCollectionView.RestoreLiveShaping() at…
Joe
  • 6,773
  • 2
  • 47
  • 81
4
votes
1 answer

Error: This type of CollectionView does not support changes to its SourceCollection

I have an ObservableCollection of items, which I need to be able to update and have the data represented still using an ICollectionView. Here are relevant bits of code: private ObservableCollection heroesDBHeroes; public…
pingu2k4
  • 956
  • 2
  • 15
  • 31
4
votes
2 answers

Bind a Wpf HierarchicalDataTemplate ItemsSource to a CollectionViewSource in a dictionary?

I'm trying to display a Wpf Treeview with items sorted by a CollectionViewSource. Currently, everything is working except sorting using this code in my resource dictionary:
4
votes
1 answer

MVVM CollectionViews in WPF Application Framework (WAF)

In short my question is: How do you prefer to expose filtered/sorted/grouped ObservableCollections to Views in WAF? I was fairly happy with my first attempt which involved filtering on the VM and exposing an ICollectionView of Model objects for the…
djskinner
  • 8,035
  • 4
  • 49
  • 72
4
votes
1 answer

LongListSelector grouping using CollectionView in Windows Phone 7 or Windows Phone 8

I am facing the same problem as listed in the below tag Is it possible to use CollectionView with LongListSelector for grouping? I use the following code to bind the LongListSelector with grouping. CollectionViewSource cv = new…
David Bekham
  • 2,175
  • 3
  • 27
  • 56
4
votes
1 answer

How to add or remove an item from a CollectionViewSource?

I want to bind a datagrid.itemsource to a List with anonymous type,so i bind it to a collectionViewSource,but i need to add or remove an item to the list,but i don't know how?
mahboub_mo
  • 2,908
  • 6
  • 32
  • 72
3
votes
1 answer

Binding Path for nested objects

Im just getting to grips with databinding, Im struggling with binding to properties that are nested within an ObservableCollection further down the object, namely In a DataTemplate of a ListView I am trying to bind to the Day.DayDate property…
tinmac
  • 2,357
  • 3
  • 25
  • 41
3
votes
1 answer

SortDescription with converter

I have list Persons Person has ID, something like that:12231d4sa32fd I have a converter that convert the ID to Status: (Ready/Waiting/NotHere). I show the list in a ListView. Question: How can I sort the ListView by the Person's status ?
Erez
  • 6,405
  • 14
  • 70
  • 124
3
votes
1 answer

c# DataGrid BindingListCollectionView custom filter throwing invalid usage of aggregate function mean

I have a collection view in which I would like to apply the filter greater than average. Issue is column type is string. So normal greater than with any number works perfect after converting to double type, issue is how to do it for average. I tried…
ThomasBecker
  • 388
  • 6
  • 20
3
votes
0 answers

Does ListCollectionView.CustomSort use a stable sort?

I sort a list in xaml using a ListCollectionView and a Comparer, and in another location in C# I need to sort in the exact same way, using the same Comparer, so the sort needs to be stable. This sort is unstable: myCollectionCopy =…
eriksmith200
  • 2,159
  • 5
  • 22
  • 33
3
votes
2 answers

CollectionViewSource+PropertyGroupDescription - count of items in a group

In my WPF application I have a CollectionViewSource which is providing a view to a private ObservableCollection. The CollectionViewSource has a PropertyGroupDescription which is utilised in a ListBox to present data to the User's preference. Using a…
LiamV
  • 1,138
  • 1
  • 14
  • 21
3
votes
2 answers

C#/WPF: Why is tab not focusing properly

I have a tab control That is bound to Tabs in the ViewModel. I also used CollectionViewSource to focus tabs protected…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
3
votes
1 answer

Strange behavior of CollectionViewSource code-behind binding MVVM

I have MainWindow.xaml (View) and MainWindowViewModel.cs (ViewModel). In my program i have custom class for async loading data at startup in Worklist.Result (observablecollection). At this moment i need use custom filtering data. If i create…
user1576474
  • 554
  • 1
  • 5
  • 10