IDataGridLookup.Dimension

Syntax

Dimension: IUiDimension;

Description

The Dimension property determines the dictionary, by which elements the entered values are searched for.

Comments

If this property is set, search in the dictionary is executed by the attribute, when entering values to the cell. The attribute's application is Identifier. Names of the found elements are displayed in a cell field but a cell value corresponds to the entered value.

Example

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;

On pressing the button the D_TO dimension combined tree is built in the first component column.  After selecting dimension element, name of this element is displayed in a cell. Cell value contains identifier of the selected element.

If the LookUp property is not set, after selecting the element, the identifier of the selected element is displayed in a cell.

See also:

IDataGridLookup

IDataGridColumn.EditorBinding