Lookup: IDataGridLookup;
The Lookup property determines the display parameters of a selected element in the drop-down list of dictionary.
Executing the example requires a form with the Button1 button on this form and the DataGrid component named DataGrid1. The repository has a dictionary with the D_TO identifier.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Obj: IMetabaseObjectDescriptor;
Begin
MB := MetabaseClass.Active;
Obj := MB.ItemById("D_TO");
UiDimension1.Object := Obj;
UiDimension1.Active := True;
Col := DataGrid1.Columns.Item(0);
Col.Lookup.Dimension := UiDimension1;
Col.EditorBinding := "UI=""DimCombo""ID=""D_TO""SELECTIONMODE=SingleSelect";
End Sub Button1OnClick;
After clicking the button a drop-down list of the D_TO dictionary is inserted into first column of component. After selecting the dictionary element its name is displayed in a cell. Cell value contains identifier of the selected element.
If the LookUp property is not set, then after selecting the element, the identifier of the selected element is displayed in a cell.
See also: