Hi, in the project I'm working on, we have a drop down list that has 7000+ entries that it has to select from.
When we try to use the filterable dropdown control, it try's to load all the entries in that are in the collection, before it allows the filtered set to show in the list below it.
This causes a very noticeable delay (Note at this point we already have the data loaded from the backend into a list in the page, so the delay is NOT caused by the data being loaded from the rest api we are using), before the users of the application can begin to type anything into the search field (Several seconds in some cases)
In our previous version before we used radzen, we solved this problem using the html datalist template, a text box and an update on every key press that dynamically replaced all entries in the data list, something similar to the following code:
<input class="form-control @_validationClass"
id="@myId"
list="listFor@(myId)"
@onchange="@((args) => _selectedCustomer = args.Value.ToString())"
placeholder="@ChooseText" />
<datalist id="listFor@(myId)">
@foreach (var customer in CustomerList)
{
<option value="@($"{customer.CustomerText}")" />
}
</datalist>
I've tried to replicate this using the radzen controls, as follows:
<RadzenTextBox Name="@myId" @oninput=@((cust) => textBoxChanged(cust.Value.ToString())) />
<datalist style="border: 2px solid red;" id="listFor@(myId)">
@foreach (var item in DisplayList)
{
<option value="@($"{item.Text}")" /> }
</datalist>
@code {
[Parameter] public List<DropDownListStringEntry> DataList { get; set; } = new List<DropDownListStringEntry>();
private List<DropDownListStringEntry> DisplayList = new List<DropDownListStringEntry>();
private string myId = RandomStringUtils.RandomAlphanumeric(10);
private void textBoxChanged(string selectedCustomer)
{
if(string.IsNullOrEmpty(selectedCustomer))
{
DisplayList = new List<DropDownListStringEntry>();
return;
}
DisplayList = DataList.Where(I => I.Text.Contains(selectedCustomer)).Take(5).ToList();
}
But I notice that RadzenTextBox does not make available the "list" attribute to allow me to attach the datalist html element to the input so I can dynamically show the users the top 5 results and allow them to click them and select them into the input box.
We can't use the drop down search as it's too slow (Unless there is a way to speed it up).
We have brought an enterprise subscription to the radzen components, in anticipation of asking for help, but my email keeps getting rejected saying my address is listed as a spammers address.
Thanks for any ideas/assistance that you can provide.