RadzenDropDown Error Pressing Key

Hi,

If I type a letter while the DropDown is not in the "search mode", i.e. not expanded, I am getting the following error.

[2024-04-23T16:35:52.637Z] Error: System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.ArgumentNullException.Throw(String paramName)
   at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
   at System.Linq.Queryable.AsQueryable[TElement](IEnumerable`1 source)
   at Radzen.DropDownBase`1.HandleKeyPress(KeyboardEventArgs args, Boolean isFilter, Nullable`1 shouldSelectOnChange)
   at Radzen.DropDownBase`1.OnKeyPress(KeyboardEventArgs args, Nullable`1 shouldSelectOnChange)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

It only happens when the drop down has not been expanded yet.

Since it doesn't happen on your demo page, I'm assuming it's something in my code. But if you have any clues form the error message above, let me know.

Thanks,
Mike

Check if you are using the latest version.

Hi, I am using version: 4.29.9

I see 4.30.0 was just released - I will try again with the latest version.

Thanks,
Mike

In case it helps anyone else, I had the same issue where I was getting a NullReferenceException when pressing pretty much any key, even if it was just the Shift key. I am using the latest version of Radzen.Blazor (4.30.2). I had a similar StackTrace where Radzen.DropDownBase`1.HandleKeyPress was the source of the exception.

In my case I was binding Data to an IEnumerable (actually a List) rather than an IQueryable which is what @sys_mike seems to be using.

It turns out I had a value of null as one of the items in my list and it was this null value that was causing the exception.