show loader in the combo

Hi,

I use sfcombobox to load results from a rest api request everytime a user type in the text box

During the loading I would like to show a loader.

I can't find any ways to do it.

Any ideas?

Can you help?

1 Reply 1 reply marked as answer

KG Kanimozhi Gunasekaran Syncfusion Team October 2, 2020 09:50 AM UTC

Hi Alexis,

 
Greetings from Syncfusion. 
We have checked your requirement “While loading the DataSource, showing loader in SfComboBox” from our side. We achieved your requirement using the SfBusyIndicator. Before update the DataSource enable the IsBusy in SfBusyIndicator after that set false. During the loading time SfBusyIndicator has indicate the time delay. We have prepared the same in simple sample.

Code Snippet: 
public async void UpdateDataSource(string text) 
       
            if (!string.IsNullOrEmpty(text) && !isSelected) 
            { 
                busyindicator.IsBusy = true; 
            } 
            foreach (var item in Collection) 
           
                if (item.Contains(text)) 
               
                    if (!dataSource.Contains(item)) 
                   
                        dataSource.Add(item); 
                        comboBox.DataSource = dataSource; 
                    
               
           
            await Task.Delay(1000); 
            busyindicator.IsBusy = false; 
            isSelected = false; 
       


Sample Link:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/ComboBox_Sample879859952

Please check with above sample and let us know if you have any concern on this.

Regards,
Kanimozhi G. 


Marked as answer
Loader.
Up arrow icon