IRdsDictionaryBox.FindElement

Syntax

FindElement(Name: String; StartFrom: Integer): Integer;

Parameters

Name - name of the element, by which searched is executed.

StartFrom - key of the element, starting with which search is executed.

Description

The FindElement method searches the MDM dictionary element, which name is passed by the Name parameter.

Comments

If search is successful, the method returns a key of a found element, otherwise - -1.

Example

Executing the example requires a form with the Button1 button, the RdsDictionaryBox component named RdsDictionaryBox1, and the UiRdsDictionary component that is a data source for RdsDictionaryBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    i: Integer;
Begin
    i := RdsDictionaryBox1.FindElement(Measures, -2);
    If i <> -1 Then
        RdsDictionaryBox1.FocusedElement := i;
    End If;
End Sub Button1OnClick;

After executing the example on pressing the button the MDM dictionary element that name begins with the word Measures is searched. Search is executed by all elements tree. If search is successful, the first found element is focused.

See also:

IRdsDictionaryBox