DropDownList with Enum as datasource causes Nullreferenceexception

"Syncfusion.Blazor.DropDowns" Version="19.4.0.48"

-


<SfDropDownList TItem="string" TValue="BusStopDirection" DataSource="@_directions"
                @bind-Value="@gridContextItem.Direction" AllowFiltering="true" >
</SfDropDownList>

privateIEnumerable _directions =Enum.GetNames(typeof(BusStopDirection));




The result was found in HttpContext:

at Syncfusion.Blazor.DropDowns.SfDropDownList`2.d__474.MoveNext()


The value itself is selected and bound.


2 Replies

AK Alexey Kazakevich April 8, 2022 12:06 PM UTC

I realized that this is due to AllowFiltering="true".

But it is so terribly done that it is generally implicit and incomprehensible. TERRIBLE!



VJ Vinitha Jeyakumar Syncfusion Team April 11, 2022 02:11 PM UTC

Hi Alexey,

We have tried to reproduce the reported issue by using Enum as a data source to the Multiselect Dropdown and also used the AllowFiltering property as true. but unfortunately we didn't face any issues as you reported. we have also prepared a sample for your reference,

Can you please share the issue reproducing entire code snippet and runnable issue replicating sample to replicate the issue on our end.

Regards,
Vinitha

Attachment: MultiselectServer_a0a779be.zip

Loader.
Up arrow icon