Programmatically Clear Dropdown Filter

Is there a way to programmatically clear the the dropdown filter?

I want a behavior where the user can reset the form. Clearing the bound data doesn't seem to have an impact on the filter. Running my own JS to clear the filter text, doesn't change the displayed items, and running JS to clear the displayed items breaks the component.

If there's some general Blazor trick to reset the component not specific to Radzen, I'm all ears for that too.

1 Like

Check this thread:

1 Like

Ah perfect! Thanks for the quick reply.

Sorry for the post. I did a search and even had some suggested similar topics pop up before I posted mine, but missed that one.

1 Like

Hi @enchev,

Is this issue fixed?

Thanks.

Hey @Developer,

Yes, this method is added. You have full access to the source code to check it.

1 Like

Hey @enchev,

Thanks for rapid reply like Radzen components.

I looked up the source code but I didn't see anything about automatically reset search input. Which class or file do I need to lookup?

Is this (master/Radzen.Blazor/RadzenDropDown.razor) correct location?

Thanks.

As I already suggested you, you can add the source code to debug how the component works. In this case you’ve missed the base class of the component:

1 Like

I also had the same problem, how do I remove the previous lookup value while keeping selected item in case of blank search? reset () will delete the selected value if no results are found in the previous search.