Values not showing in Radzen MultiSelect

Good morning,

New to using the components and followed the example but the dropdown is not showing the values (clicking the icon does not reveal items for selection).

Here is my code:
<RadzenDropDown @bind-Value=@values Data=@reqTypes TextProperty="@nameof(RequestTypes.RequestType)" ValueProperty="@nameof(RequestTypes.RequestTypeID)" Name="drpDown_RequestTypes"
Multiple=true AllowClear=true Placeholder="Select Request Type(s)" Style="width: 100%; max-width: 400px;" />

@code {
string tempstring = string.Empty;
string fileName = string.Empty;
long? fileSize;

IEnumerable<int> values;
IEnumerable<RequestTypes> reqTypes;

protected override async Task OnInitializedAsync()
{
    await base.OnInitializedAsync();

    values = new List<int>() { 0, 1 };

    var fcrmMetricsServices = new FCRMMetricsServices(Configuration);

    var fcrmMetricsServicesResult = fcrmMetricsServices.GetRequestTypes();

    reqTypes = fcrmMetricsServicesResult.ToList();

}

}

We can’t run this code to test it - it’s hardly readable also since it’s not even formatted. Check our forum FAQ on how to improve your post.

My apologies, here is a code snippet (create it with a simple list instead of code directly from the database). Objects still in the same concept.

@page "/metrics_reporting/loginsfail"

@rendermode InteractiveServer


@inject IConfiguration Configuration

<RadzenDropDown @bind-Value=@values Data=@reqTypes TextProperty="@nameof(RequestTypes.RequestType)" ValueProperty="@nameof(RequestTypes.RequestTypeID)" Name="drpDown_RequestTypes"
                Multiple=true AllowClear=true Placeholder="Select Request Type(s)" Style="width: 100%; max-width: 400px;" />

@code {

    public class RequestTypes
    {
        public int RequestTypeID { get; set; }
        public string RequestType { get; set; }
    }

    IEnumerable<int> values;
    IEnumerable<RequestTypes> reqTypes;

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        values = new List<int>() { 5 };

        var requestTypeList = new List<RequestTypes>();
        requestTypeList.Add(new RequestTypes() { RequestTypeID = 1, RequestType = "Negative Media review" });
        requestTypeList.Add(new RequestTypes() { RequestTypeID = 2, RequestType = "Politically Exposed Person Review (Determination?)" });
        requestTypeList.Add(new RequestTypes() { RequestTypeID = 3, RequestType = "Marijuana review (prohibited client review?)" });
        requestTypeList.Add(new RequestTypes() { RequestTypeID = 4, RequestType = "Manual Non Broker Dealer Review (Schwab Banking and Trust Services Review?)"});
        requestTypeList.Add(new RequestTypes() { RequestTypeID = 5, RequestType = "AML Hotlist Review" });
        requestTypeList.Add(new RequestTypes() { RequestTypeID = 6, RequestType = "Other (Only visible to AML Special Risk?)" });

        reqTypes = requestTypeList.AsEnumerable<RequestTypes>();

    }

}


Here is what I see with this code in our demos:

Wow....I am not seeing the drop down items

I see that you’ve declared explicitly render mode for your page to be interactive still it will be useful to check if the page is really interactive - a simple button will raise click event if everything is as it should.

I passed this in and it work

<button onclick="myFunction()">Click me</button>

<p id="demo"></p>

<script>
function myFunction() {
  document.getElementById("demo").innerHTML = "Hello World";
}
</script>

Check also if there are some errors in the browser console - might prevent the component to work properly. You can also check using the browser element inspector what and where is rendered.

Here is the browser errors
image

There are no errors on this screenshot. Check if the popup is rendered, where and with what styles.

Not sure what you mean..sorry

Thanks...will review. By the way...would running this locally (localhost) cause this issue

I don’t think that can cause such issue.

I think the control may be loading twice and that is causing the data problem. I actually see the control twice on the page and Chrome is indicating that as an issue.

This article describes a little of it: .NET 8 Blazor component visibly loading twice? Check your prerendering

Follow up on this....it is definitely creating the control twice when there is attempt to load data (I had controls on the page that were not populated with data and there was only one instance).

Working through the render modes to determine the best route