Hi,
We recently updated to the latest release 2020.2.617 and we now have an issue that was not present in 2018.3.911.
Our GridView is bound to a list of objects inheriting from DynamicObject. If the user sorts the list using the mouse and then presses our refresh button the sorting disappears. Our refresh button just binds a completely new list containing the exact same data as before.
In 2018.3.911 the sorting is retained after a refresh.
Any assistance would be greatly appreciated.
Regards
Anthony
5 Answers, 1 is accepted
Hi Anthony,
Would you find it possible to demonstrate this issue in a small sample project so that I can further investigate and assist you? You can either upload the project to a storage provider of your choice or open a new support ticket in order to do so.
Thank you in advance for your cooperation on the matter.
Regards,
Dilyan Traykov
Progress Telerik
Hi,
I have attached an example (rename to .zip) using the Telerik examples.
Sort a column using the mouse and then press the refresh button, the sorting disappears.
Regards
Anthony
Hi Anthony,
Thank you very much for the provided sample project.
I traced this difference in behavior to the following bug fix which we introduced just after the 2018.3.911 release.
The behavior you now observe is expected as there is no way for the control to know whether the new collection is the same as the old one and in such cases, it is up to the developers to preserve the sort/filter/group descriptors if they choose to do so.
I hope you find this information helpful. Do let me know if I can be of any further
Regards,
Dilyan Traykov
Progress Telerik
Hi,
I am working around this by remembering the sorted columns and applying them afterwards. It doesn't produce a good user experience as the grid is drawn and then sorts it afterwards and visually jumps.
I would have thought that the control could do the same thing that I am doing manually. When the collection is changed, note the names of the sorted columns and apply the sorting if the same columns exist afterwards.
Everybody using this control would expect this is the way it should behave. Unless I missed it, I could not find anywhere in the documentation that warned about this "new" behaviour.
Regards
Anthony
Hi Anthony,
Preserving the sort descriptors seemed counterintuitive for our users who reported the bug and also led to undesired results. After discussion, we agreed that that is indeed the case and if such a requirement was present, developers would be able to implement it manually.
As this change in behavior comes from a bug in the control, it is not listed in our documentation, however, it is included in our release notes for the R1 2019 release:
"Data descriptors are now cleared when ItemsSource is changed with another collection of the same dynamic types, as dynamic types do not guarantee the same set of properties."
I hope you find this information helpful. Please let me know if there's anything else I can help you with.
Regards,
Dilyan Traykov
Progress Telerik