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
0 answers

ICollectionView cancel currentchanging

I am looking for a way to cancel the CurrentChanging event depending on the item that was clicked. In my application I use ICollectionView to hold my list of viewmodels which are rendered as tabitems in a tabcontrol. For a specific viewmodel I need…
tabina
  • 1,095
  • 1
  • 14
  • 37
1
vote
1 answer

ComboBox bound to ICollectionView is displaying incorrect SelectedItem

I'm having an issue with a pair of combo box's in Silverlight 4.0. The intention is to have two different comboboxes that read from the same list, but if any item selected in one won't show up in the other (as the underlying properties are not…
Alastair Pitts
  • 19,423
  • 9
  • 68
  • 97
1
vote
2 answers

Treeview, ICollectionView and binding to SelectedValue or SelectedItemChanged

I am totally new to whole WPF world. I want to create a simple (for now) app with only one window but in MVVM way. I'm build it in .NET 7 with nuget packages: CommunityToolkit.Mvvm 8.1.0 and Microsoft.Xaml.Behaviors.Wpf 1.1.39. Layout of my app I'm…
Myszax
  • 33
  • 4
1
vote
2 answers

WPF unexpected ICollectionView behavior

I'm new to WPF, and just learning how things work. My endgoal is to have a datagrid for each heading which displays totals from a collection of items associated with each category. But I'm seeing some unexpected behavior. I expect to see this…
1
vote
1 answer

WPF: ICollectionView - Filter one list if item is contained in another list?

Basically, I have 2 ListView's each binding to a different ItemsSource. List 1 can not be changed (it's a ReadOnlyObservableCollection). List 2 can be changed (through user interaction). I need to add a filter to List 1 so that it doesn't display…
michael
  • 14,844
  • 28
  • 89
  • 177
1
vote
1 answer

WPF design time ICollectionView binding silently fails

I have both ICollectionView and ObservableCollection (for now) exposed from view model: public ICollectionView ItemsView { get => !IsInDesignMode ? _itemsView : CollectionViewSource.GetDefaultView(new…
wondra
  • 3,271
  • 3
  • 29
  • 48
1
vote
1 answer

CollectionViewSource doesn't update the UI

I am trying to implement a filtering and paging on a ListView. I managed to do the filtering but I observed that the UI doesn't get updated when I am adding/removing items from the collection. Here is my setup: XAML:
Rock3rRullz
  • 357
  • 1
  • 4
  • 21
1
vote
1 answer

Update item in BindableCollection with notify ICollectionView

Hi I bind collection from Caliburn Micro on ListBox control in view. Here is it. public BindableCollection Friends { get { return _friends; } set { _friends = value; NotifyOfPropertyChange(() => Friends); …
user572844
1
vote
1 answer

Initially hide elements in ListView (uses ICollectionView and ObservableCollection)

I am using a ListView which is bound to a ICollectionView (ListCollectionView -> ObservableCollection) While loading a file containing data the collection gets filled. Every data item has a boolean flag, which indicates if it must be shown in the…
Ferhat
  • 471
  • 3
  • 9
  • 21
1
vote
2 answers

Can't add new item to Silverlight DataForm when ICollectionView is sorted or filtered

I've got a DataForm on a Silverlight 4 page. I bind it to the View on the class below. I am able to add, delete, edit, and move forward/back through records just fine using the controls built into the DataForm. But as soon as I remove the comment…
JustinM
  • 913
  • 9
  • 24
1
vote
0 answers

Binding issues in System.ComponentMode.ICollectionView with ValueTuple collections

I'm a big fan of the new c# 7 ValueTuples. But here is one scenario where I'd like to use them, and it isn't working for me. If I create an ICollectionView against a collection of ValueTuples, it won't let me define sort descriptions. I guess…
David Beavon
  • 1,141
  • 9
  • 16
1
vote
1 answer

Filtering issue with ICollectionView

ImageAlbums is an ICollectionView type and GlobalCollection.MyImageAlubms is an ObservableCollection type. ImageAlbums = CollectionViewSource.GetDefaultView(GlobalCollection.MyImageAlubms); ImageAlbums.Filter = new…
lukai
  • 536
  • 1
  • 5
  • 20
1
vote
0 answers

Mock data not showing when bound to ICollectionView

If I bound my ListBox to ViewModels ObservableCollection or XAML resourced CollectionViewSource, the mock data shows while in design. Sometimes CollectionViewSource stops showing this data because of some XAML changes, but after rebuilding the code…
1
vote
3 answers

WPF - How to bind ICollectionView to datagrids using MVVM

I am new to WPF and following this link to use code first method to build the example. And the example works. https://msdn.microsoft.com/en-us/data/jj574514.aspx Now, I am trying to change it to follow MVVM. Here is the MainWindow XAML
Owen Lee
  • 349
  • 1
  • 5
  • 19
1
vote
1 answer

Items inside Groups in ICollectionView are not sorted

I have an ObservableCollection: public ObservableCollection Collection { get; set; } = new ObservableCollection { "AA", "BB", "CC", "C", "A", "C", "BBB", "AAA", "CCC" }; A ListBox in the…
wingerse
  • 3,670
  • 1
  • 29
  • 61
1 2 3
8 9