380 questions
0
votes
1
answer
93
views
WPF CollectionViewSource not updating UI
I have a very simple application, where I want populate the ListView when the user presses a button. I am using CollectionViewSource to update the ListView when the button is pressed, but I cannot ...
1
vote
1
answer
67
views
Does EnableCollectionSynchronization also require locking use of the ICollectionView?
I am familiar with BindingOperations.EnableCollectionSynchronization to make WPF participate in locking access to an ObservableCollection for use on multiple threads.
But does this place the same ...
0
votes
2
answers
759
views
Binding Issue in MAUI CollectionView: Property "FileName" Not Found in DataContext
I am working on a .NET MAUI application and am having trouble binding a property in a CollectionView. Specifically, I am trying to display a list of uploaded files and their filenames, but I am ...
0
votes
2
answers
545
views
Adding a SortDescription to a CollectionViewSource clears the view's filter
My code-behind builds a CollectionViewSource to sort and filter a collection of objects representing disk folders. It exposes its View to my XAML. I initially wrote the code to build the object like ...
2
votes
2
answers
5k
views
.Net MAUI: How to select single and multiple items using MVVM and CollectionView
Problem
I'm attempting a multi selection using CollectionView and MvvM. The (official docs don't do the greatest job of differentiating between normal code-behind and MVVM, and for us noobies that ...
4
votes
0
answers
1k
views
AvaloniaUI - Equivalent of CollectionViewSource
We like to migrate our WPF-App to AvaloniaUI and stumble over a couple of CollectionViewSource entries:
<CollectionViewSource x:Key="SortedMethods" Source="{Binding Methods}&...
0
votes
1
answer
537
views
MAUI - Collection View Pre Select Item background color change
I am working on MAUI technology and developing Windows Application So, I have a requirement to pre-select the item in collection view and that item need to be highlighted. so, I have checked the ...
0
votes
1
answer
836
views
CollectionView ThresholdReachedCommand fired before loading complete
Has a question regarding CollectionView in MAUI.
So, I have CollectionView wrapped to RefreshView.
<RefreshView Grid.Row="1"
Command="{Binding RefreshSearchCommand}"...
2
votes
3
answers
838
views
What is the proper usage of CollectionView(Source) in MVVM pattern?
I'm trying to be as strict as possible when designing MVVM applications in terms of separating layers. In particular, I do my best to never leak anything platform-related to my viewmodels, and by ...
0
votes
1
answer
581
views
how to select first row in DataGrid and to sort the data I'm using CollectionViewSource in wpf MVVM
I am working on WPF application using MVVM model ,I am using DataGrid which is having 3 columns and second column is datatime column.In DataGrid I want to display last added record as first row means ...
0
votes
1
answer
96
views
How to simply filter a Collection(View)(DataGrid) through a ComboBox via Item Property?
after searching for hours and hours over weeks (at SO and google, I even asked ChatGPT), I was not able to find a Solution for my (simple?) Problem, although I have become close to my desired result.
...
-3
votes
1
answer
243
views
Is sorting using CollectionView performance efficient?
I have a ICollectionView which serves as an input source for a WPF ListView. The number of items (text messages) in the CollectionView could be upto 10 thousands. I want to add a sorting creiteria to ...
1
vote
2
answers
895
views
WPF Application UI freezing despite collection view source being updated by a background worker
I have an app that retrieves data from a database and displays it in data grid on the main window. The maximum number of items being displayed is ~5000.
I don't mind a time delay in display the ...
0
votes
1
answer
124
views
What effet does CollectionViewSource.GetDefaultView has on Threading context?
Consider the unit test below :
[TestMethod]
public void MVCE()
{
asyncMethodNoCollectionView().Wait(); // Does not fail
asyncMethodWithCollectionView().Wait(); // Fails
}
private async Task ...
-1
votes
1
answer
555
views
CollectionViewSource Filter a Collection view with a list of items
i will try to explain my problem best i can,
i have my collection view:
CollectionViewSource ArticoliProduzioneViewSource;
that need to be filtered by 3 list of items
public ObservableCollection<...
1
vote
0
answers
33
views
CollectionViewSource filtering logic in xaml
I have a CollectionViewSource defined in xaml:
<CollectionViewSource x:Key="DetailsViewSource1" Source="{Binding DetailsList}"
xmlns:scm="clr-namespace:System....
0
votes
2
answers
460
views
How to add a databound table to a collectionview grid in Xamarin
I know that Xamarin XAML does not support an HTML table:
<table><th/><tr><td>Data Here</td></tr></table>
I have a databound collection view that gets data ...
1
vote
1
answer
314
views
Unable to assign CollectionViewSource.Source by System.Data.DataTable object in UWP
Good day.
I am trying to display data from System.Data.DataTable in Microsoft.Toolkit.Uwp.UI.Controls.DataGrid. I bind the component to the table through the CollectionViewSource.
Under UWP, cannot ...
-1
votes
1
answer
477
views
WPF CollectionViewSource in ResourceDictionary
I've CollectionViewSource in ResourceDictionary file.
MenuItems.xaml
<!--This code is not working-->
<CollectionViewSource Source="{Binding DynamicMenuItems, RelativeSource={...
1
vote
1
answer
1k
views
What is the proper usage of CollectionViewSource in terms of MVVM in WPF?
CollectionViewSource class is supposed to provide a so-called "view" over data. This includes data filtering, sorting and grouping.
Now, one may think, that this is a responsibility of a ...
2
votes
1
answer
641
views
CollectionViewSource in WPF not displaying data from DataTable
The data from the DataTable doesn't fill the ComboBox or TextBox. Data from a SQL Server database is used to fill a DataTable, which is working fine, and I think the CollectionViewSource is okay as ...
0
votes
1
answer
206
views
Is there a way to do what ListViewHeaderItem exactly do?
I want to realize a custom view just like ListView.
Now the problem is I want get a Tapped event from group header, maybe more.
It always creates GroupItem as group view, and can't be change.
I found ...
0
votes
1
answer
522
views
WPF ListView bound to collection - find parent expander
I've writing an app that displays a list of drawings, as a test I've written a small app that displays how I envisage it working.
The app works by:
Creating a BrowserItem class, this has a name ...
-1
votes
2
answers
183
views
CollectionViewSource.Filter is not raised with several CVS for the same collection in Datagrid
I am sharing a the same collection of items among several view models in a DataGrid. When one item on this shared list is selected, I need it to disappear from the list of the others items.
Here are ...
1
vote
0
answers
375
views
Wpf Sort enum description on alpabet
I use the description tag for an enum to create a more human readable representation of that option, for example:
''' <summary>
''' Indicates something cool
''' </summary>
<...
-1
votes
2
answers
2k
views
Binding observable collection to a TreeView in WPF
Thanks in advance,
I want to bind an observable collection to a TreeView in WPF such that it should display the each TreeView Node as a CountryType. The TreeView is bound to this collection from code ...
0
votes
1
answer
541
views
How to bind CollectionViewSource to DataGrid
I have a datagrid and want to bind its item source as CollectionViewSource which has the source of List. But binding is not working. Please check my code in below. Note that i dont want to use ...
-1
votes
1
answer
564
views
Why is `ICollectionView.MoveCurrentToNext` moving to items that are not in the filter range?
I have a CollectionView that is filtered by a predicate. When I debug this, I can see that the result view only contains the items that match the filter. However, when I use the MoveCurrentTo*()-...
1
vote
1
answer
2k
views
How to get the source collection of ICollectionView preserving the sort order?
In my WPF application, I have an ICollectionView that I use to display a list of data in a data grid after filtering and sorting. Once I do the filtering and sorting the way I like, I would like to ...
1
vote
1
answer
81
views
WPF Combobox sorting, but initally no entry selected?
I implemented sorting for a WPF combobox using the following XAML:
<CollectionViewSource x:Key="SortedAreas" Source="{Binding AllAreas}">
<CollectionViewSource.SortDescriptions>
<...
1
vote
1
answer
607
views
How to make Scrollable Label in List Xamarin Forms
I have a List view with fixed Row Height. Inside List view there is Label with large description. I am trying to make this label scroll able. Can anyone help please.
<ListView ItemsSource="{...
0
votes
1
answer
593
views
CollectionViewSource filtering only in xaml
My textbox provides the filtered string to the collection and when I enter new value in the textbox, I want my collection to be refreshed as per the new filter value. I want to put the filtering logic ...
0
votes
1
answer
1k
views
CollectionViewSource is not triggering the filter event when refresh is called
The idea is, I have a textbox in which I type a string, this string will filter the collectionviewsource which is a treeview. Attaching the code below:
The sorting and grouping are working fine.
...
0
votes
1
answer
666
views
Filtering CollectionViewSource with multiple filters
I was reading this: https://social.technet.microsoft.com/wiki/contents/articles/26673.wpf-collectionview-tips.aspx and have tried to apply it to my code without success.
PendingTrucks = (...
0
votes
1
answer
200
views
Binding an Image control to a datagrids datacontext (viewmodel)
I have a WPF DataGrid that is bound to a CollectionViewSource. The view source contains some data about rental properties, i.e. the address and an image of that property. The DataGrid shows the ...
0
votes
1
answer
191
views
Implement deferred item loading in a grouped ICollectionView
I have a set of items (~12.000) i want to show in a ListView. Each of those items is a view model that has an assigned image that is not part of the app package (it's in an 'external' folder on a ...
0
votes
1
answer
142
views
Locate a record in a C# CollectionViewSource
I have a CollectionViewSource that contains a set of indexed records extracted from an MS SQL Server Table called Example using Entity framework 6.2.
Example is declared as a DbSet property of my ...
3
votes
1
answer
451
views
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 ...
2
votes
0
answers
220
views
Xamarin Forms CollectionView throwing NSInternalInconsistencyException
I have a Xamarin forms project which consists of a ColectionView whose ItemSource is backed by a bindable property of type ObservableCollection in the ViewModel. Adding new items to the ...
0
votes
1
answer
201
views
How to move multiple selected items in a ListBox back to another ListBox?
I've succeeded to move multiple items in LeftListBox to RightListBox. Now, I'd like to move them back from RightListBox to LeftListBox. However, it gives me "System.NullReferenceException". Here is my ...
0
votes
1
answer
179
views
How to get an update on CollectionViewSource.View.Count in UWP
I am retrieving the FileInformation.DisplayName property of circa 5k files in a folder using FileInformationFactory.GetVirtualizedFilesVector() to display them in a GridView in UWP via a ...
0
votes
1
answer
339
views
How to make a DependencyProperty on a Custom Control accept a CollectionViewSource Binding?
Background:
I can create a CollectionViewSource in XAML taking data from an ObservableCollection on the Window.
Binding the CollectionViewSource to a DataGrid behaves exactly as expected (ItemsSource="...
0
votes
1
answer
200
views
Refreshing A CollectionViewSource On A Button Click?
While learning WPF, as I started with developing a User Interface for a sample database like NorthWind as at Microsoft's VS Docs, I came up with a View Refreshing Code Piece like:
custViewSource.View....
0
votes
1
answer
87
views
How to insert an image from a local folder where filename match item from a CollectionViewSource
I'm building my first application in WPF, and I'm trying to add an image from a local folder to the listview. The folder has images where the filename consist of 10 digits (e.g 1234567890.jpg).
The ...
0
votes
1
answer
898
views
What is the C# equivalent of XAML's "/" in data-binding paths?
I have 3 entities in entity framework:
collection
subcollection
subsubcollection
The collection entity has a one-to-many relationship with the subcollection entity, which in turn has a one-to-many ...
2
votes
1
answer
636
views
How to pass a CollectionViewSource to a converter?
I have something like this:
<UserControl.Resources>
<ResourceDictionary>
<CollectionViewSource x:Key="filteredSymbols" Source="{Binding Symbols ,RelativeSource={...
0
votes
1
answer
627
views
Binding child nodes to CollectionViewSource
So here is my data structure:
MyViewModel
Docs (ObservableCollection<Doc>)
Specs (ObservableCollection<Spec>)
i.e. the ViewModel has an ObservableCollection named Docs that is a ...
2
votes
1
answer
719
views
Test if the current entry is the first or last entry in a CollectionViewSource
I am reading rows from an MS SQL Server table into a C# CollectionViewSource via Entity Framework. One row = one collection entry.
I use data binding to connect each CollectionViewSource entry's data ...
1
vote
1
answer
1k
views
Filter a CollectionViewSource and then sort manually
I have an ObservableCollection<Recipe> which is bound to an ICollectionView. It is possible to filter by my personal predicate implementation. The ICollectionView is bound on a dataGrid.
Now I ...
1
vote
2
answers
1k
views
CollectionViewSource grouping, get sum(Quantity)
I have a CollectionViewSource whose source is an ObservableCollection.
On a List or ObservableCollection, I can use linq to group my objects, and sum their quantities, but how is it possible to do it ...