windowsforms-devexpress-dot-xtratreelist-dot-treelist-41118acc.md
Allows you to filter search results when a user searches in the Advanced Customization Form.
Namespace : DevExpress.XtraTreeList
Assembly : DevExpress.XtraTreeList.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList
[DXCategory("Action")]
public event TreeListCustomizationFormSearchEventHandler CustomizationFormSearch
<DXCategory("Action")>
Public Event CustomizationFormSearch As TreeListCustomizationFormSearchEventHandler
The CustomizationFormSearch event's data class is DevExpress.XtraTreeList.TreeListCustomizationFormSearchEventArgs.
The Customization Form integrates the search box that allows users to locate columns and bands by their captions. Handle the CustomizationFormSearch event to implement a custom search algorithm. This event fires for each item (column or band) in the Customization Form when a user enters text in the search box.
The following example handles the CustomizationFormSearch event to display the child elements of a band in the Customization Form if the band matches the search string.
private void treeList1_CustomizationFormSearch(object sender, DevExpress.XtraTreeList.TreeListCustomizationFormSearchEventArgs e) {
string bandCaption = e.OwnerBandCaption.ToLower();
if(bandCaption.Contains(e.SearchText.ToLower()))
e.Visible = true;
}
Private Sub treeList1_CustomizationFormSearch(ByVal sender As Object, ByVal e As DevExpress.XtraTreeList.TreeListCustomizationFormSearchEventArgs)
Dim bandCaption As String = e.OwnerBandCaption.ToLower()
If bandCaption.Contains(e.SearchText.ToLower()) Then
e.Visible = True
End If
End Sub
See Also