I'm trying to use a Blazor SfDropDownList with the URL adapter to a custom (non web api) api hosted in the same project. The Dropdown list is returning "No results found" and the browser is correctly calling the URL and returning the payload according to the documentation.
How do I get the SfDropDownList to show data from a custom URL?
Payload returned from the browser network panel:
{
"result":[ {"value":"sample 1","text":"sample 1"}, {"value":"sample 2","text":"sample 2"} ], "count":19 }
Blazor Code:
<SfDropDownList TValue="string" TItem="ListItemStringOnly" PopupHeight="230px" Placeholder="Select a type" @bind-Value="EquipmentType"> <SfDataManager Url="@Url" Adaptor="Adaptors.UrlAdaptor" CrossDomain=true Offline="true"></SfDataManager> <DropDownListFieldSettings Text="Text" Value="Value" /> <!-- tried lower case text and value as well --> </SfDropDownList> @code { string EquipmentType { get; set; } string Url; protected override async Task OnInitializedAsync() { Url = new EquipmentTypeLookup().ToReplyUrl(); } }
public class ListItemStringOnly { public string Value { get; set; } public string Text { get; set; } public ListItemStringOnly(string val) { Value = val; Text = val; } }
This is what is shown in the ui (non formatted):