Having a field for text and values in a model is mandatory at this point (that is, you need a List<someObject>).
How would you expect binding to a list of primitive types to work? How would the dropdown choose what values to render? Would something like the following snippet suit your needs, assuming it worked (it will not work now, as an entire model is required)?
At the moment I can see the following options as potentially viable, although each of them would have its drawbacks:
- Define item type and value type to let the component know what it will be using, and define custom templates to let it know what to render, like in the snippet below.
- An alternative would be that if a List<string> is used that it automatically gets rendered and chosen as values, but that may limit templates and would then raise the question "what if I want to use an integer, or a float, or some other number, or a boolean".
selected value: @MyItem
> MyList =
; } =
That said, I would encourage you to post a public feature request for the way you want to see this work, perhaps including a similar pseudocode sample that you would expect to work as a sample way of how the component API should be modified/used. You can do that from this link (or from the "Request a Feature" link in the feedback portal), just make sure to select the "make public" checkbox in the last page.
Progress Telerik UI for Blazor