This question is locked. New answers and comments are not allowed.
Internal Support
Top achievements
Rank 1
Internal Support
asked on 01 Feb 2011, 09:53 PM
I am using a GridView bound to an ObservableCollection. Single column sorting works as desired. Multi-colum sorting has an issue, though. The first time an additional column is added to the sorts, it will work fine, and be reflected in the SortDescriptors of the underlying collection. However, if the direction of that sort is changed, it will not reflect this change in the Sort Descriptors, although the GridView sort display will change. This applies to each additional column sort applied.
I investigated the _Sorting and _Sorted events on the GridView. The _Sorting event is correctly showing the change in the direction of the sort, but when the _Sorted event is reached, that change is gone. I tried manually setting the sort direction on the column during the _Sorting event, but that change was also ignored.
I investigated the _Sorting and _Sorted events on the GridView. The _Sorting event is correctly showing the change in the direction of the sort, but when the _Sorted event is reached, that change is gone. I tried manually setting the sort direction on the column during the _Sorting event, but that change was also ignored.
7 Answers, 1 is accepted
0
Internal Support
Top achievements
Rank 1
answered on 03 Feb 2011, 05:42 PM
I am wondering if anyone else has seen this behavior or similar problems - we're not doing anything strange regarding the data binding or data source.
0
Hello Margaret,
Maya
the Telerik team
I have tried to reproduce the issue you specified, but I was not able to. I am sending you the sample project I used for testing it. Please take a look at it and let me know in case of any misunderstandings.
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Internal Support
Top achievements
Rank 1
answered on 04 Feb 2011, 11:43 PM
I looked at your test project and realized what I had said - I had misspoken, we are using a PagedCollectionView rather than an ObservableCollection, because the sort descriptors are more accessible to the view model there. I modified the example you had sent to me to demonstrate the error - there is now a text box displaying a textual output of what the PagedCollectionView thinks the sorts are, so you can see how the first sort works, and the second one works only the first time.
I can't attach it directly here, so if you need to see the code let me know where to attach it, or I can dump the files in a long reply. Thanks!
I can't attach it directly here, so if you need to see the code let me know where to attach it, or I can dump the files in a long reply. Thanks!
0
Internal Support
Top achievements
Rank 1
answered on 09 Feb 2011, 10:15 PM
Still waiting for a response. I'm pretty sure that this issue is caused by the fact that SortDescriptions become "sealed" once created, and cannot be updated, only replaced later.
0
Hello Margaret,
Maya
the Telerik team
Indeed, once the Players collection is defined as a PagedCollectionView the sorting gets a bit incorrect. However, I have tested the application with the binaries from our Latest Internal Build and everything works as expected and the multi-sorting is applied as required. So, you may download those assemblies from your Telerik account and give them a try on your application.
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Internal Support
Top achievements
Rank 1
answered on 17 Feb 2011, 07:16 PM
I've used the new binaries, and it is working much better now. There is only one remaining issue I've noticed.
Say you have 3 sorts, such as:
Column A (ASC), Column B (ASC), Column C (ASC)
If you click on the header of Column B in order to reverse it's sort direction from ASC to DESC, the order of the sorts will change to:
Column A (ASC), Column C (ASC), Column B (DESC)
rather than to
Column A (ASC), Column B (DESC), Column C (ASC)
as I believe users would expect.
Say you have 3 sorts, such as:
Column A (ASC), Column B (ASC), Column C (ASC)
If you click on the header of Column B in order to reverse it's sort direction from ASC to DESC, the order of the sorts will change to:
Column A (ASC), Column C (ASC), Column B (DESC)
rather than to
Column A (ASC), Column B (DESC), Column C (ASC)
as I believe users would expect.
0
Hi Margaret,
Maya
the Telerik team
This will be the expected behavior since a SortDescriptor is removed and added in the collection afterwards.
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!