This is a migrated thread and some comments may be shown as answers.

Sorting Lost When Refreshing When Binding To DynamicObject

5 Answers 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Veteran
Anthony asked on 22 Jul 2020, 12:07 AM

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

Sort by
0
Dilyan Traykov
Telerik team
answered on 24 Jul 2020, 11:04 AM

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

0
Anthony
Top achievements
Rank 1
Veteran
answered on 27 Jul 2020, 12:16 AM

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

0
Dilyan Traykov
Telerik team
answered on 28 Jul 2020, 12:36 PM

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

0
Anthony
Top achievements
Rank 1
Veteran
answered on 28 Jul 2020, 10:08 PM

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

0
Dilyan Traykov
Telerik team
answered on 29 Jul 2020, 01:12 PM

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

Tags
GridView
Asked by
Anthony
Top achievements
Rank 1
Veteran
Answers by
Dilyan Traykov
Telerik team
Anthony
Top achievements
Rank 1
Veteran
Share this question
or