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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #103518
    twnicholas
    Participant

    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.

    #103521
    admin
    Keymaster

    Hi,

    You can add it to your code as Smart.Blazor.Button to avoid ambiguous usage.

    Best regards,
    Peter Stoev

    Smart UI Team
    https://www.htmlelements.com/

    #103523
    twnicholas
    Participant

    I 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?

    #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/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.