Blazor ComboBox Example - Data Binding

ComboBox / Data Binding

This example demonstrates the ComboBox's data binding support. Type a character(s) in the ComboBox component and the remaining characters will be automatically filled based on the first matched item or select an item from the suggestion list by clicking the ComboBox dropdown icon. When you type or click dropdown icon on the remote data ComboBox, the loader icon will appear until the remote request retrieves the data from the server and displays it.

Loading Syncfusion Blazor Server Demos…

The ComboBox loads the data either from local data sources or remote data services through the DataSource property. It supports the data type of Array, Observable Collection, ExpandoObject, DynamicObject and DataManager.

The DataManager, that acts as an interface between the service endpoint and ComboBox will require the following minimal information to interact with the service endpoint properly.

  • DataManager.Url - Defines the service endpoint to fetch data.
  • DataManager.Adaptor - Defines the adaptor option. By default, ODataAdaptor is used for remote binding. The adaptor is responsible for processing responses and requests from/to the service endpoint. Syncfusion.Blazor.Data package provides some predefined adaptors that are designed to interact with particular service endpoints. They are:

    • UrlAdaptor - Use this to interact with any remote services.
    • ODataAdaptor - Use this to interact with OData endpoints.
    • ODataV4Adaptor - Use this to interact with OData V4 endpoints.
    • WebApiAdaptor - Use this to interact with Web API created under OData standards.
    • WebMethodAdaptor - Use this to interact with web methods.

Below are the different types of data binding used in this sample.

  • Local Data ComboBox is bound to a collection of sports data.
  • Remote Data ComboBox is bound to a collection of customer data using DataManager.
  • Observable Collection ComboBox is bound to a ObservableCollection of colors data.
  • ExpandObject ComboBox is bound to the collection of vehicles data of type ExpandObject.
  • DynamicObject ComboBox is bound to the collection of customers data of type DynamicObject.

See also

Transform your Blazor web apps today with Syncfusion® Blazor components
100+ high-performance and responsive UI components
Dedicated support
Hassle-free licensing
TRY IT FOR FREE