Error in binding data on RadzenDropDown #758

Closed
opened 2026-01-29 17:42:55 +00:00 by claunia · 1 comment
Owner

Originally created by @PouryaMontakhab on GitHub (Mar 4, 2023).

Hello guys. I am trying to wrap RadZenDropDown with a viewcomponent in asp core project and passing data and selectedValues from view componenet class. The code is looks like this:

 @code {
[Parameter]
public IEnumerable<int> values { get; set; }

[Parameter]
public IEnumerable<CityListVm> cities { get; set; }

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

<RadzenDropDown @bind-Value=@values Data=@cities TextProperty="LocalizedName" ValueProperty="Code" Multiple=true AllowClear=true Placeholder="Select city" MaxSelectedLabels="2" SelectAllText="Select all items" SelectedItemsText="are now selected" />

and here is how I call the razor file:

<component type="typeof(RadZenMultiSelect)" render-mode="Server" param-cities="@Model.Model" param-values="@Model.Model.Select(a=>a.Code)" />

when I run the project I get an error like this :

Connection disconnected with error 'Error: Server returned an error on close: Connection closed with an error.'.
Error: Server returned an error on close: Connection closed with an error.
Error: Circuit host not initialized.

if I try to remove the param-cities and param-values in the component tag and prepare them inside the razor file in @code{} section, the code works well but I want to pass data and selectedValues outside razor file so that I can use this component for the another data.

any suggestion?

Originally created by @PouryaMontakhab on GitHub (Mar 4, 2023). Hello guys. I am trying to wrap RadZenDropDown with a viewcomponent in asp core project and passing data and selectedValues from view componenet class. The code is looks like this: > @code { [Parameter] public IEnumerable<int> values { get; set; } [Parameter] public IEnumerable<CityListVm> cities { get; set; } protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); } } `<RadzenDropDown @bind-Value=@values Data=@cities TextProperty="LocalizedName" ValueProperty="Code" Multiple=true AllowClear=true Placeholder="Select city" MaxSelectedLabels="2" SelectAllText="Select all items" SelectedItemsText="are now selected" />` and here is how I call the razor file: ` <component type="typeof(RadZenMultiSelect)" render-mode="Server" param-cities="@Model.Model" param-values="@Model.Model.Select(a=>a.Code)" />` when I run the project I get an error like this : **Connection disconnected with error 'Error: Server returned an error on close: Connection closed with an error.'. Error: Server returned an error on close: Connection closed with an error. Error: Circuit host not initialized.** if I try to remove the param-cities and param-values in the component tag and prepare them inside the razor file in `@code{} `section, the code works well but I want to pass data and selectedValues outside razor file so that I can use this component for the another data. any suggestion?
Author
Owner

@PouryaMontakhab commented on GitHub (Mar 4, 2023):

I think found the problem. it is because I was trying to send a large list via WebSocket and there was a limitation for signalR for those who maybe ran into this problem in the future.

@PouryaMontakhab commented on GitHub (Mar 4, 2023): I think found the problem. it is because I was trying to send a large list via WebSocket and there was a limitation for signalR for those who maybe ran into this problem in the future.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#758