BoldDeskBoldDesk is now live on Product Hunt with a special offer: 50% off all plans. Let's grow together! Support us.
DropDownList value is:@DropVal
@using Syncfusion.EJ2.Blazor.DropDowns
DropDownList value is:@DropVal
<EjsDropDownList Placeholder="e.g. Australia" TItem="Countries" TValue="int?" Value="@DropVal" DataSource="@Country">
<DropDownListEvents TValue="int?" ValueChange="onChange"></DropDownListEvents>
<DropDownListFieldSettings Value="Code" Text="Name"></DropDownListFieldSettings>
</EjsDropDownList>
@code {
public int? DropVal = 0;
public class Countries
{
public string Name { get; set; }
public int Code { get; set; }
}
List<Countries> Country = new List<Countries>
{
new Countries() { Name = "Australia", Code = 1 },
new Countries() { Name = "Bermuda", Code = 2 },
new Countries() { Name = "Canada", Code = 3 },
new Countries() { Name = "Cameroon", Code = 4 },
};
private void onChange(Syncfusion.EJ2.Blazor.DropDowns.ChangeEventArgs<int?> args)
{
DropVal = args.Value;
StateHasChanged();
}
}
|