TreeCombo.OnFilter

Fore Syntax

Sub OnFilter(Sender: Object; Args: ITreeSearchNodeEventArgs);

Begin

//set of operators;

End Sub OnFilter;

Fore.NET Syntax

Sub OnFilter(pSender: System.Object; pArgs: Prognoz.Platform.Interop.Forms.TreeSearchNodeEventArgs);

Begin

//set of operators;

End Sub OnFilter;

Parameters

Sender. Parameter that returns the component that generated the event.

Args. Parameter that enables the user to determine event parameters.

Description

The OnFilter event occurs after the list of components is filtered.

Comments

This event occurs for each found element, which is finally put to the filtered list of elements. It is possible to control the display of element in the filtered list by means of the Show property.

Fore Example

Executing this example requires a form and the TreeCombo component on it. The OnBeginFilter and OnFilter event handlers are set for the component.

Class TESTForm: Form
    TreeCombo1: TreeCombo;

    Sub TreeCombo1OnBeginFilter(Sender: Object; Args: ITreeSearchEventArgs);
    Begin
        Debug.WriteLine("Filtering by text: " + Args.SearchText);
    End Sub TreeCombo1OnBeginFilter;

    Sub TreeCombo1OnFilter(Sender: Object; Args: ITreeSearchNodeEventArgs);
    Begin
        If Args.Node.Text.IndexOf("Old") <> -1 Then
            Args.Show := False;
        End If;
    End Sub TreeCombo1OnFilter;
End Class TESTForm;

If the component is focused, its list is collapsed and characters are entered, the elements list is filtered. The text, by which filtering is executed, is displayed in the development environment component. If the element contains the text "Old" in its name, such elements are hidden in the final list. After filtering the obtained elements list is displayed.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Forms.Net;

Public Partial Class TESTForm: Prognoz.Platform.Forms.Net.ForeNetForm
    Public Constructor TESTForm();
    Begin
        InitializeComponent();
    End Constructor;

    Private Sub treeComboNet1_OnBeginFilter(pSender: System.Object; pArgs: Prognoz.Platform.Interop.Forms.TreeSearchEventArgs);
    Begin
        System.Diagnostics.Debug.WriteLine("Filtering by text: " + pArgs.SearchText);
    End Sub;

    Private Sub treeComboNet1_OnFilter(pSender: System.Object; pArgs: Prognoz.Platform.Interop.Forms.TreeSearchNodeEventArgs);
    Begin
        If pArgs.Node.Text.IndexOf("Old") <> -1 Then
            pArgs.Show := False;
        End If;
    End Sub;

End Class;

See also:

TreeCombo