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
Tagged: blazor dropdownlist
- This topic has 3 replies, 2 voices, and was last updated 2 years, 3 months ago by admin.
-
AuthorPosts
-
August 22, 2022 at 10:40 pm #103518twnicholasParticipant
We’ve got several Blazorise applications. I’m looking into using Smart UI in some of them. I’m getting a bunch of errors like,
Error (active) CS0104 ‘Button’ is an ambiguous reference between ‘Smart.Blazor.Button’ and ‘Blazorise.Button’ PCT.ChemLab
Is there a simple way to avoid these errors? Can they play nicely with each other?
Thanks.
August 23, 2022 at 5:04 am #103521adminKeymasterHi,
You can add it to your code as Smart.Blazor.Button to avoid ambiguous usage.
Best regards,
Peter StoevSmart UI Team
https://www.htmlelements.com/August 23, 2022 at 6:52 pm #103523twnicholasParticipantI did that and it solved the compilation issue. Thank you.
I installed the Smart.Blazor NuGet package and followed the instructions on this site. I/We have not purchased the library (yet). Not sure if the issues are due to not having a license. I would like to try it out before we purchase it. We’re looking for a drop down that supports multiple selection.
I’m assuming I’m doing something wrong, but not sure what at this point. Currently, I’m getting System.InvalidOperationException: ‘Cannot get the value of a token type ‘Null’ as a boolean.’ when the page loads.
<Smart.Blazor.DropDownList DataSource=”@chemLabAlertEmailsSelectArray”
SelectionMode=”Smart.Blazor.ListSelectionMode.ZeroOrMany”
@bind-SelectedValues=”@chemLabAlertEmailsSelectedArray”>
@foreach (var alertEmail in chemLabAlertEmails)
{
<Smart.Blazor.ListItem Value=”alertEmail.AlertEmailAddress”>@alertEmail.AlertEmailAddress</Smart.Blazor.ListItem>
}
</Smart.Blazor.DropDownList>chemLabAlertEmails is a List not an array but changing it to an array changes nothing.
Any ideas?
August 24, 2022 at 5:23 am #103524adminKeymasterHi,
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 StoevSmart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.