DxComboBox<TData, TValue>.SearchDelay Property
Specifies the delay between a user’s last input in the edit box and the initiation of the search.
Namespace: DevExpress.Blazor
Assembly:
DevExpress.Blazor.v25.1.dll
NuGet Package:
DevExpress.Blazor
Declaration
[DefaultValue(0)]
[Parameter]
public int SearchDelay { get; set; }
Property Value
Type |
Default |
Description |
Int32 |
0 |
A time interval, in milliseconds.
|
The DevExpress Blazor ComboBox can search for text that users type in the edit box.
Use the SearchDelay
property to specify the time interval between a user’s last input and the subsequent update of the ComboBox. If the user continues to type during this delay, the timer restarts. This behavior helps limit frequent updates and reduce associated data requests (such as database queries or REST API calls) while the user types. To update the search text immediately, the user can press the Enter key or move focus away from the editor.
The following code specifies the search mode, condition, and delay:
<DxComboBox Data="Staff.DataSource"
@bind-Value="@Value"
SearchMode="ListSearchMode.AutoSearch"
SearchFilterCondition="ListSearchFilterCondition.Contains"
SearchDelay="1000">
<Columns>
<DxListEditorColumn FieldName="FirstName"></DxListEditorColumn>
<DxListEditorColumn FieldName="LastName"></DxListEditorColumn>
<DxListEditorColumn FieldName="Department"></DxListEditorColumn>
</Columns>
</DxComboBox>
@code {
string Value { get; set; }
}
namespace StaffData {
public static class Staff {
private static readonly Lazy<List<Person>> dataSource = new Lazy<List<Person>>(() => {
var dataSource = new List<Person>() {
new Person() { Id= 0 , FirstName="John", LastName="Heart", Department=Department.Electronics },
new Person() { Id= 1 , FirstName="Samantha", LastName="Bright", Department=Department.Motors },
new Person() { Id= 2 , FirstName="Arthur", LastName="Miller", Department=Department.Software },
new Person() { Id= 3 , FirstName="Robert", LastName="Reagan", Department=Department.Electronics },
new Person() { Id= 4 , FirstName="Greta", LastName="Sims", Department=Department.Motors },
new Person() { Id= 5 , FirstName="Brett", LastName="Wade", Department=Department.Software },
new Person() { Id= 6 , FirstName="Sandra", LastName="Johnson", Department=Department.Electronics },
new Person() { Id= 7 , FirstName="Edward", LastName="Holmes", Department=Department.Motors },
new Person() { Id= 8 , FirstName="Barbara", LastName="Banks", Department=Department.Software },
new Person() { Id= 9 , FirstName="Kevin", LastName="Carter", Department=Department.Electronics },
new Person() { Id= 10, FirstName="Cynthia", LastName="Stanwick", Department=Department.Motors },
new Person() { Id= 11, FirstName="Sam", LastName="Hill", Department=Department.Electronics }};
return dataSource;
});
public static List<Person> DataSource { get { return dataSource.Value; } }
}
public class Person {
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public Department Department { get; set; }
public string Text => $"{FirstName} {LastName} ({Department} Dept.)";
public override bool Equals(object obj) {
if (obj is Person typedObj) {
return (this.Id == typedObj.Id) && (this.FirstName == typedObj.FirstName) && (this.LastName == typedObj.LastName)
&& (this.Department == typedObj.Department);
}
return base.Equals(obj);
}
}
public enum Department { Motors, Electronics, Software }
}
Run Demo: ComboBox - Search and Filter Data
See Also