<SfDropDownList TItem="GameFields" TValue="int?" PopupHeight="230px" Placeholder="Select a game" @bind-Value="@BrandId" DataSource="@Games">
<DropDownListFieldSettings Text="Text" Value="ID">DropDownListFieldSettings>
SfDropDownList>
@code
{
public int? BrandId { get; set; } = 8;
public class GameFields
{
public int ID { get; set; }
public string Text { get; set; }
}
private List
new GameFields(){ ID= 1, Text= "American Football" },
new GameFields(){ ID= 2, Text= "Badminton" },
new GameFields(){ ID= 3, Text= "Basketball" },
new GameFields(){ ID= 4, Text= "Cricket" },
new GameFields(){ ID= 5, Text= "Football" }
};
}
|