MetabaseTreeCombo.OnCheckToAddElem

Syntax

Sub OnCheckToAddElem(Sender: Object; Args: IMetabaseTreeNodeSpecialEventArgs);

Begin

//set of operators;

End Sub OnCheckToAddElem;

Parameters

Sender. The parameter that returns the component that has generated the event.

Args. The parameter that determines event parameters.

Description

The OnCheckToAddElem event occurs in adding elements to tree.

Comments

The event occurs when a tree is built for each element displayed in the tree. Unlike the OnIsBrowseableElem event, the OnCheckToAddElem event also occurs for any folders and band objects.

The Node property of event argument can be used to get the current element, for which the event has been generated. If the Special property of event argument is set to True, the current Node element will be displayed in the component tree. When the Special property is set to False, the element will be hidden.

Example

Executing the example requires a form and the MetabaseTreeCombo component on the form. The procedure specified below is a handler of the OnCheckToAddElem event.

Sub MetabaseTreeCombo1OnCheckToAddElem(Sender: Object; Args: IMetabaseTreeNodeSpecialEventArgs);
Var
    s: String;
Begin
    s := Args.Node.ObjectDescriptor.Id;
    
If s.IndexOf("SYSTEM") <> -1 Then
        Args.Special := 
False;
    
End If;
End Sub MetabaseTreeCombo1OnCheckToAddElem;

After the form is started, the component element tree does not display the objects containing SYSTEM in their identifiers. Both repository objects and folders and band container will be hidden.

See also:

MetabaseTreeCombo