SelectedItem is the entire data item, you need @bind-Value however it will be of type object as well since the DropDown can have multiple selection and in this case Value can be IEnumerable. You can cast to desired type. More info can be found here (check the source code): https://blazor.radzen.com/dropdown
Yes, I checked it and do like it but I bind value to a model int property
<RadzenDropDown AllowFiltering="true" AllowClear="true" @bind-Value="car.DepartId" Data="deptList" TextProperty="DepartName" ValueProperty="Id" />
I have updated nuget from 1.0.9 to 1.0.12 and I have problems with DropDown with multiple selection. I have seen you have back to IEnumerable<string>. I have also change object to string but I have other problem with selectItem and selectall.
I'd like you to test this several cases. (I can't understand how DropDown works, yet)
This is definitely a bug and it is fixed immediately! Update of Radzen.Blazor was just published.
I'm not sure I understand the idea here. The DropDown will select items based on ValueProperty which in this case is CustomerID. Both selects will create multiple items with same CustomerID.
I wanted to say that I proposed you to try the demo by changing the original line (customers = await Task.FromResult(dbContext.Customers;) for option a), b1) & b2) but only one option at the same time.
Bs Options are in order to test with some no EF solution.
Yes, thanks again for the report! Now the DropDown will work normally not only with IQueryable but with other generic IEnumerable including arrays, lists, etc.
I have tried version 1.1.0 and It works better, but I can't work in next case (multiple="true"):
fill customers with list,
"customers = await Task.FromResult(dbContext.Customers.ToList());"
and try to select all items
browser error message:
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Radzen.Blazor.RadzenDropDown`1.SelectAll()
at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync[T](MulticastDelegate delegate, T arg)
at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, Object arg)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(UInt64 eventHandlerId, EventFieldInfo fieldInfo, EventArgs eventArgs)