This example binds DevExpress Blazor ListBox, ComboBox, and TagBox to a remote Web API service and uses the CustomData
property to implement custom data load logic.
To bind an editor to data from a Web API service, complete the following steps:
-
Reference the DevExtreme.AspNet.Data library in your project. Add the following directives to files where you will write data loading code:
- @using DevExtreme.AspNet.Data
- @using DevExtreme.AspNet.Data.ResponseModel
-
Use a component's
CustomData
property to implement an ansynchronous function. This function returns a Task<LoadResult> object and accepts the following parameters:- A DataSourceLoadOptionBase object.
- A CancellationToken object.
-
In the remote service, implement an API controller and create a
LoadResult
object based on load options.