Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
@ToDisplay <SfComboBox TValue="string" TItem="Country" Placeholder="Select a country" AllowCustom="false" PopupHeight="auto" DataSource="@CountryJsonAsync"><ComboBoxEvents TValue="string" TItem="Country" ValueChange="@ChangeCountry"></SfComboBox><ComboBoxFieldSettings Text="CountryName.common" Value="CountryId">
private static List CountryJsonAsync;
private string ToDisplay;
protected override async Task OnInitializedAsync() { CountryJsonAsync = await HttpClient.GetFromJsonAsync<List<Country>>("https://localhost:44306/data/countries-na.json"); ToDisplay = JsonSerializer.Serialize(CountryJsonAsync) + Environment.NewLine + Environment.NewLine;
ToDisplay = ToDisplay + CountryJsonAsync[0].CountryName.common + "-" + CountryJsonAsync[0].CountryId + Environment.NewLine + Environment.NewLine; ToDisplay = ToDisplay + CountryJsonAsync[1].CountryName.common + "-" + CountryJsonAsync[1].CountryId;
StateHasChanged();}