Replies: 1 comment
-
This is, by definition, not possible. A Combobox allows for typing and thereby 'selecting' an option that is not part of the initial list. There is no way then to the specify what the value-part of that typed option would be. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using fluentui blazor 3.0.0-RC.1.
I'm wondering if there is an option or a way i don't see to configure FluentCombobox with a key pair int-string.
I'm use to fill my combobox using enum value (int) and description but fluent option require (string - string) or (int - int).
I would have needed (int - string) or (enum - string).
`
<FluentCombobox @bind-Value=SelectedProvince TOption="string" >
@foreach (var province in Provinces)
{
@province.Value
}
@code{
public Dictionary<Province, string> Provinces = new Dictionary<Province, string>();
public Province SelectedProvince = 0;
protected override async Task OnInitializedAsync()
{
Provinces = Enum.GetValues(typeof(Province)).Cast().ToDictionary(pro => ((int)pro).ToString(), pro =>
Enumeration.GetDescriptionLocaliser(pro,CultureInfo.CurrentCulture));
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions