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!
When the DataSource is changed dynamically in the page, the ComboBox dropdown list is not changed at all, it remains the first version of the DataSource.
As much as I could investigate, the ComboBox.ListData/ListDataSource are showing always the first version of DataSource. The ComboBox.DataSource is changing correctly. But the dropdown list of items is not correct. Please see the code below to recreate the issue:
<p>Current Count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
<SfComboBox TItem="Person" TValue="int" Placeholder="Select Person" @ref="@comboObj" PopupHeight="230px" DataSource="@People" @bind-Value="@selectedId">
<ComboBoxFieldSettings Text="Name" Value="Id"/>
</SfComboBox>
@code {SfComboBoxcomboObj; ListPeople = new List { new Person { Id = 0, Name = "Mark" } }; Person selectedPerson;int selectedId;string[] names = new string[] { "Mark", "John", "Jack", "Jim", "Jonas", "James" };private int currentCount = 1;private void IncrementCount(){if (currentCount<5)People.Add(new Person { Id = currentCount, Name = names[currentCount] });currentCount++;StateHasChanged();}public class Person{public int Id { get; set; }public string Name { get; set; }}}