Back to Devexpress

TreeList.CustomizationFormSearch Event

windowsforms-devexpress-dot-xtratreelist-dot-treelist-41118acc.md

latest2.9 KB
Original Source

TreeList.CustomizationFormSearch Event

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

Declaration

csharp
[DXCategory("Action")]
public event TreeListCustomizationFormSearchEventHandler CustomizationFormSearch
vb
<DXCategory("Action")>
Public Event CustomizationFormSearch As TreeListCustomizationFormSearchEventHandler

Event Data

The CustomizationFormSearch event's data class is DevExpress.XtraTreeList.TreeListCustomizationFormSearchEventArgs.

Remarks

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.

csharp
private void treeList1_CustomizationFormSearch(object sender, DevExpress.XtraTreeList.TreeListCustomizationFormSearchEventArgs e) {
    string bandCaption = e.OwnerBandCaption.ToLower();
    if(bandCaption.Contains(e.SearchText.ToLower()))
        e.Visible = true;
}
vb
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

Behavior

UseAdvancedCustomizationForm

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace