I have a View with that I am injecting a service using @inject . The service provides Lookup list data that is not provided from the controller.
i.e. @inject ProfileOptionsData options
How would I set the datasource property to bind the dropdownlist to a method from this service?
Thank you
1 Answer, 1 is accepted
0
Ianko
Telerik team
answered on 15 Mar 2018, 11:00 AM
Hello Joe,
There is no built-in facility to bind the DataSource to a method from an injected service.
You can, however, use the Items method of the DropDownList with an Action, where you can traverse the result of the service method and add the items dynamically. Similar to this example code: