|
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.4.51/fabric.css" rel="stylesheet" />
<script src="https://cdn.syncfusion.com/ej2/17.4.51/dist/ej2.min.js"></script>
<script src="https://cdn.syncfusion.com/ej2/17.4.51/dist/ejs.interop.min.js"></script> |
|
<EjsComboBox TValue="string" @bind-Value="@comboVal" PopupHeight="230px" AllowCustom="true" Autofill=true Placeholder="Select a game" DataSource="@Games">
<ComboBoxFieldSettings Text="Text" Value="ID"></ComboBoxFieldSettings>
</EjsComboBox>
@code {
public string comboVal { get; set; } = "Badminton";
public class GameFields
{
public string ID { get; set; }
public string Text { get; set; }
}
public List<GameFields> Games = new List<GameFields>() {
new GameFields(){ ID= "Game1", Text= "American Football" },
new GameFields(){ ID= "Game2", Text= "Badminton" },
new GameFields(){ ID= "Game3", Text= "Basketball" },
new GameFields(){ ID= "Game4", Text= "Cricket" },
new GameFields(){ ID= "Game5", Text= "Football" },
new GameFields(){ ID= "Game6", Text= "Golf" },
new GameFields(){ ID= "Game7", Text= "Hockey" },
new GameFields(){ ID= "Game8", Text= "Rugby"},
new GameFields(){ ID= "Game9", Text= "Snooker" },
new GameFields(){ ID= "Game10",Text= "Tennis"}
};
} |