JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › General Discussions › Is there a simple way to add Smart.dropdownlist to an existing Blazorise applica › Reply To: Is there a simple way to add Smart.dropdownlist to an existing Blazorise applica
August 24, 2022 at 5:23 am
#103524
admin
Keymaster
Hi,
With the DropDownList, you should choose whether to create it with the DataSource property set or you will add the ListItem elements. It is not possible to have both things at the same place.
For example:
<DropDownList @bind-SelectedIndexes="selectedIndexes" DataSource="dataSource" Filterable></DropDownList>
@code {
private int[] selectedIndexes = new int[] { 0 };
private List<string> dataSource = new List<string>()
{
"Affogato",
"Americano",
"Bicerin",
"Breve",
"Café Bombón",
"Café au lait",
"Caffé Corretto",
"Café Crema",
"Caffé Latte",
"Caffé macchiato",
"Café mélange",
"Coffee milk",
"Cafe mocha",
"Cappuccino",
"Carajillo",
"Cortado",
"Cuban espresso",
"Espresso",
"Eiskaffee",
"The Flat White",
"Frappuccino",
"Galao",
"Greek frappé coffee",
"Alabala",
"Indian filter coffee",
"Instant coffee",
"Irish coffee",
"Liqueur coffee"
};
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/