DropDown doesn't Bind Null Item

OK I have a DropDown displaying a list of months. It's bound to a List<KeyValuePair<int?, string>> and to a Int? property.

<RadzenDropDown @bind-Value="Input.CreditCard.ExpirationMonth" TValue="int?" Data="@ExpirationMonths" ValueProperty="Key" TextProperty="Value" class="form-control" id="ExpirationMonth" />

For another string DropDown where the default item is "", then selecting the empty value displays the text of the default item.

In this int? list, however, when selecting the first item, no text gets displayed. I can select the first null item in the list but then the box will be blank instead of displaying that item's text.

Is this by design or a bug? Any way to work around this?

Also, if I set ID property on the DropDown, it gets set on the DIV instead of the INPUT. Is there any way to set the ID on the INPUT so that I can refer to it with a "label for" ?

Hi @Hanuman,

This is by design. The default value of the DropDown is null so you can't have another item that has a Value of null. You can use the Placeholder property to have some text displayed initially when the dropdown is empty.

All custom attributes get applied to the outer HTML element. There is no way to set the ID attribute to the <input> element rendered by the DropDown.