Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
150121 | Dec 21,2019 06:14 AM UTC | Dec 23,2019 04:41 AM UTC | Blazor | 1 |
![]() |
Tags: Dropdown List |
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();
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.