Loading busy indicator in DropDownFooterView.
In Xamarin.Forms ComboBox, you can add the SfBusyIndicator when the data is being loaded with the help of DropDownHeaderView or DropDownFooterView. In the following example, the SfBusyIndicator has been loaded in the DropDownFooterView until the data is fetched.
Code snippets [Xaml]:
<StackLayout Padding="10"> <Label Text="ComboBox"/> <comboBox:SfComboBox x:Name="comboBox" HeightRequest="45" IsEditableMode="True" SuggestionMode="Contains" MaximumDropDownHeight="150" ShowDropDownFooterView="True" DropDownFooterViewHeight="60" ValueChanged="comboBox_ValueChanged" NoResultsFoundText="No Results" AllowFiltering="True" DisplayMemberPath="Name"> <comboBox:SfComboBox.DropDownFooterView> <Grid VerticalOptions="StartAndExpand" HeightRequest="60" BackgroundColor="#f0f0f0" > <busyIndicator:SfBusyIndicator VerticalOptions="Start" x:Name="busyindicator" AnimationType="SlicedCircle" ViewBoxWidth = "40" ViewBoxHeight="40" TextColor="Maroon" IsBusy="True"/> </Grid> </comboBox:SfComboBox.DropDownFooterView> </comboBox:SfComboBox> </StackLayout>
Code snippets [C#]:
private async void DataChanged() { await Task.Delay(4000); busyindicator.IsBusy = false; comboBox.DropDownFooterViewHeight = 0; if (comboBox.DataSource == null) { LoadItems(); } } private void comboBox_ValueChanged(object sender, Syncfusion.XForms.ComboBox.ValueChangedEventArgs e) { DataChanged(); }
Output:
Please use the sample link for the clarification.
Conclusion
I hope you enjoyed learning about how to loading busy indicator in DropDownFooterView.
You can refer to our Xamarin.Forms ComboBox feature tour page to know about its other groundbreaking feature representations. You can also explore our Xamarin.Forms ComboBox documentation to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!