ListBox issues

Hi folks,

I'm working with the last version and have some problems with the listbox component in a blazor webassembly app.

Here comes the code:

<RadzenListBox @bind-SelectedItem="@selected" TValue="FacultyOverviewModel" Data="@testList" TextProperty="FacultyName" ValueProperty="Id" Style="margin-bottom: 20px;height:200px;" />

private FacultyOverviewModel selected;

Seems simple, but compiler throws CS0266 exception: Cannot implicitly convert to "FacultyOverviewModel". I'm not working with EF, the model class behind is a simple class with 2 string properties (FacultyName and Id).

Any ideas?

Stefan

Hi Stefan,

Your ListBox TValue must be the type of the ValueProperty. What is the type of Id?

Oh, yes....thats it! Thank you so much and many greetz to bulgaria!

1 Like