Sub OnCheckToAddElem(Sender: Object; Args: IMetabaseTreeNodeSpecialEventArgs);
Begin
//set of operators;
End Sub OnCheckToAddElem;
Sender. The parameter that returns the component that has generated the event.
Args. The parameter that determines event parameters.
The OnCheckToAddElem event occurs in adding elements to tree.
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.
Executing the example requires a form with the MetabaseTreeList component on the form. The procedure specified below is a handler of the OnCheckToAddElem event.
Sub MetabaseTreeList1OnCheckToAddElem(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 MetabaseTreeList1OnCheckToAddElem;
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: