Duplicated
Last Updated: 30 May 2023 10:44 by ADMIN
Harmen
Created on: 24 May 2023 08:57
Category: UI for Blazor
Type: Bug Report
0
Need to be able to reset the DropDownList. Specifically the Skip property.

In a cascading parent/child scenario (both DropDownLists), the args.Request.Skip property in the child's OnRead handler is not reset after rebinding the child data from the OnChange of the parent. This is a problem when the Skip is larger than the total amount of child items that are available from the back-end for the new parent. The api that is called in the OnRead handler returns nothing when for example the Skip still is 15 and there are only 10 items available.

I tried many things (in many different orders) to clear the child's state properly:

- set the model property which is bound to the child to it's default value
- called StateHasChanged()
- played around with Task.Delay
- set the child's value to it's default value
- set the child's Data property to null
- set the child's Data property to an empty list
- called child.Refresh()
- called child.Rebind()
- even tried to use reflection to reset the private proteced Skip property

Sort of a workaround:
In the OnRead handler after the api call compare the total item count with the skip and refetch with skip = 0 when skip > total item cound. This gives me the data I need but it is still shown at the old Skip position (with a buch of empty lines before that).

This bugreport (https://feedback.telerik.com/blazor/1558042-cascading-virtual-dropdownlist-does-not-reset-scrollbar) seems similar. In a response we are advised to clear the scrollbar position maually (which sounds a bit like the Skip position).

Please advise on how to reset the state manually because I don't see how. And if this is not possible, please add some functionality to do so. Perhaps something like the DataGrid's GetState, SetState methods?

Regards,
Harmen

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
2 comments
ADMIN
Nadezhda Tacheva
Posted on: 30 May 2023 10:44

Hi Harmen,

You are correct, this is indeed a bug. The behavior you are describing targets the bug report that you have linked.

That said, I am marking the current thread as a duplicate.

For the time being, an option I can suggest is destroying the child DropDownList and initializing it again when the selection is changed in the parent. The downside is that there will be a flicker but the skip will be reset.

Here is an example: https://blazorrepl.telerik.com/GnEJHYPa41xYUziD14.

I hope this helps.

Regards,
Nadezhda Tacheva
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Harmen
Posted on: 24 May 2023 09:08
This might not be a feature request. Could also be a bug. Sorry if I put this in the wrong category.