Sort a GridView Column When a Header Is Clicked
I'm trying to follow this example to sort a gridview colum when a header is clicked.
https://docs.microsoft.com/en-us/dotnet ... is-clicked
I'm having some trouble doing it:
How could I achive to convert this code from WPF to Noesis ? Is there a way to find this knowledge in a documentation ?
Thanks
https://docs.microsoft.com/en-us/dotnet ... is-clicked
I'm having some trouble doing it:
- 'CollectionViewSource' does not contain a definition for 'GetDefaultView' -> CollectionViewSource.GetDefaultView(lv.ItemsSource)
- headerClicked.Column.DisplayMemberBinding as Binding -> can't be converted
- headerClicked.Column.HeaderTemplate = Resources["HeaderTemplateArrowUp"] as DataTemplate -> Key "HeaderTemplateArrowUp" not found in RessourceDictionary
How could I achive to convert this code from WPF to Noesis ? Is there a way to find this knowledge in a documentation ?
Thanks
-
-
sfernandez
Site Admin
- Posts: 2062
- Joined:
Re: Sort a GridView Column When a Header Is Clicked
Sorry, but we don't have support in CollectionView for sorting.
I recommed you to just sort the collection bound to ItemsSource:
- create an empty collection
- sort original collection with the required criteria into the new collection
- update the bound collection property with the new collection
This will be the optimal way to get the collection sorted because it will trigger just a single collection changed notification.
In our next 3.0 version we created a couple of behaviors to help with sorting and filtering collections: CollectionSortBehavior and CollectionFilterBehavior (you can find the code in GitHub).
I recommed you to just sort the collection bound to ItemsSource:
- create an empty collection
- sort original collection with the required criteria into the new collection
- update the bound collection property with the new collection
This will be the optimal way to get the collection sorted because it will trigger just a single collection changed notification.
In our next 3.0 version we created a couple of behaviors to help with sorting and filtering collections: CollectionSortBehavior and CollectionFilterBehavior (you can find the code in GitHub).
Who is online
Users browsing this forum: No registered users and 1 guest