DropDownList Binding issue

Regarding the SfDropDownList in blazor.

We would like to be able to bind both the DataSource and Currently selected item to a view-model.

We get the following error when trying to bind 'Value' to a non-primative:

System.NullReferenceException: Object reference not set to an instance of an object.

         at Syncfusion.Blazor.DropDowns.DropDownListEvents`2.OnInitializedAsync()

         at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()


We can successfully bind to a .NET list/array/etc.. but we are struggling to bind to the current value, having to resort to events instead which is fragile.


Please advise, Thanks, John

 






1 Reply

BC Berly Christopher Syncfusion Team October 25, 2021 11:00 AM UTC

Hi John, 
  
Greetings from Syncfusion support. 
  
We have checked the DropDownList by assigning the data source and value to it, but the reported issue does not occurred at our end. So, we have prepared the sample and attached it below. 
  
  
So, please share any issue reproducing code or modify the attached sample with the reported issue that will help us to check and proceed further from our end. 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon