DropdownList not binding

When I attempt to pass a value into a DropdownList it appears for a brief second then disappears and the value is overriden to null. This can be seen using the following code and the linked files: 

@page "/test"
@using ThinBlueLieB.Helper.Extensions
@using Syncfusion.Blazor.DropDowns

<div class="w-25 container">
    <SfDropDownList TItem="string" TValue="TimelineinfoEnums.RaceEnum?" PopupHeight="230px" Placeholder="Race" @bind-Value="@officer.Race" DataSource="@Races">
    </SfDropDownList>
    <h3>@officer.Race</h3>
</div>

@code{
    public ViewOfficer officer { get; set; } = new ViewOfficer();
    protected override void OnInitialized()
    {
        officer.Race = TimelineinfoEnums.RaceEnum.Native;
        officer.Misconduct = new int[] { };
    }
    public IEnumerable<string> Races = EnumExtensions.GetEnumDisplayNames<TimelineinfoEnums.RaceEnum>();
}

If you run this, "Native" will appear briefly then disappear. I have attached EnumExtensions (which contains extension methods), TimelineinfoEnums(which contains RaceEnum), and ViewOfficer(which contains the ViewOfficer model); with them you should be able to replicate the issue.  How do I data-bind to and from a DropDownList?


Attachment: DropdownList_Data_Binding_Issue_362f4e3.zip

1 Reply 1 reply marked as answer

SP Sureshkumar P Syncfusion Team October 28, 2020 03:47 AM UTC

Hi Eli,  
 
Greetings from Syncfusion support. 
 
We have confirmed the Value received as null on binding Enum datatype with DisplayName() Attribute as bug in our end and include the upcoming patch release, which is scheduled on November 11th, 2020. We appreciate your patience until then  
 
You can track the status of the bug from the below feedback link.  
 
Regards, 
Sureshkumar P 


Marked as answer
Loader.
Up arrow icon