How do I get the SfComboBox to reflect changes in datasource

Hi,

How do I get SfComboBox to reflect changes in datasource? I tried adding values to datasource, clearing datasource but SfComboBox values does not change.

See attached sample.

Regards

/Stefan



Attachment: SyncfusionBlazorCombo_81fc78b9.zip

3 Replies

PM Ponmani Murugaiyan Syncfusion Team November 26, 2021 02:30 PM UTC

Hi Stefan, 
 
Greetings from Syncfusion support. 
 
We have prepared sample as per your requirement for dynamically changing the datasource or clear the datasource. Please find the code snippet and sample below for reference. 
 
public void Add() 
        { 
            Games.Add(new GameFields() { ID="Game10", Text="Tennis" }); 
            StateHasChanged(); 
        } 
        public async void Clear() 
        { 
            Games = new List<GameFields>() { }; 
            StateHasChanged(); 
        } 
 
 
Kindly check with the above sample and get back us if you need further assistance. 
 
Regards, 
Ponmani M 



ST Stefan November 26, 2021 05:50 PM UTC

Hi,

Thanks for quick reply. That works great. 

Regards

/Stefan




DR Deepak Ramakrishnan Syncfusion Team November 29, 2021 08:19 AM UTC

Hi Stefan, 
 
Thanks for your update. 
 
We are glad that your requirement has fulfilled at your end. We are always happy to assist you if you need any further assistance. 
 
Thanks, 
Deepak R. 


Loader.
Up arrow icon