I have a telerik dropdownlist that isn't closing after selection. I've looked at the answer posted here: Dropdownlist does not close after selection in UI for Blazor | Telerik Forums, but that doesn't solve my issue. My value fields match (I am using DateOnly), and the value is a Value type (struct).
Where am I making the error?
<FormItem Field="@nameof(HpuDonation.HpuScheduledPickupDate)">
<Template>
<TelerikDropDownList Width="150px" ValueField="@nameof(PickupDateTargetCapacity.PickupDate)" Data="@PickupDates" @bind-Value="@Donation.HpuScheduledPickupDate">
<ValueTemplate>
@((context as PickupDateTargetCapacity).PickupDate.ToString("MMMM d"))
</ValueTemplate>
<ItemTemplate>
@((context as PickupDateTargetCapacity).PickupDate.ToString("MMMM d"))
</ItemTemplate>
</TelerikDropDownList>
</Template>
</FormItem>
@code {
public IEnumerable<PickupDateTargetCapacity> PickupDates { get; set; } = new List<PickupDateTargetCapacityDto>();
public HpuDonation Donation { get; set; }
public class HpuDonation
{
public DateOnly HpuScheduledPickupDate { get; set; }
// other fields
}
public class PickupDateTargetCapacity
{
public DateOnly PickupDate { get; set; }
// other fields
}
}
Where am I making the error?