DxTreeList.ShowSearchBox Property
Specifies whether the TreeList displays the search box.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(false)]
[Parameter]
public bool ShowSearchBox { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | false |
|
Remarks
Set the ShowSearchBox
property to true
to display a search box in the TreeList component. When users type within the search box, the TreeList filters data rows, displays those that match the search string, and highlights search results.
You can use the following members to customize the search box:
- CustomizeElement
- Allows you to customize search box style settings.
- FilterTreeMode
- Specifies whether the TreeList component displays children/parents for rows that meet search criteria.
- SearchBoxInputDelay
- Specifies the delay between the last typed character in the search box and the search update.
- SearchBoxNullText
- Specifies the prompt text displayed in the search box when it is empty.
- SearchBoxTemplate
- Allows you to use a custom editor as the search box.
- SearchText
- Allows you to set an initial search string or implement an external search editor.
Users can press Ctrl+F to focus the search box.
Example
The following example displays a search box in the TreeList component:
@inject EmployeeTaskService EmployeeTaskService
<DxTreeList Data="TreeListData"
KeyFieldName="Id"
ParentKeyFieldName="ParentId"
ShowSearchBox="true">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" />
<DxTreeListDataColumn FieldName="EmployeeName" />
<DxTreeListDataColumn FieldName="StartDate" />
<DxTreeListDataColumn FieldName="DueDate" />
</Columns>
</DxTreeList>
@code {
List<EmployeeTask> TreeListData { get; set; }
protected override void OnInitialized() {
TreeListData = EmployeeTaskService.GenerateData();
}
}
See Also