DimGroup: IDimElementGroup;
The DimGroup property determines the dictionary elements group, based on which an element tree in the component is built.
Executing the example requires a form, a button named Button1 on the form, the DimensionTree component named DimensionTree1, the DimensionCombo component named DimensionCombo1 and the UiDimension component named UiDimension1 that is a data source for DimensionTree and DimensionCombo. The dictionary loaded into UiDimension must have two groups of elements.
The example is a handler of the OnClick event for a button.
Add links to the Dimensions, ExtCtrls, Forms, and Metabase system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Groups: IMetabaseObjectDescriptors;
ElemGroup: IDimElementGroup;
Begin
MB := MetabaseClass.Active;
Groups := (UiDimension1.Dimension As IMetabaseObject).Children;
ElemGroup := Groups.Item(0).Bind As IDimElementGroup;
DimensionTree1.DimGroup := ElemGroup;
ElemGroup := Groups.Item(1).Bind As IDimElementGroup;
DimensionCombo1.DimGroup := ElemGroup;
End Sub Button1OnClick;
After executing the example, on clicking the button in the DimensionTree1 component the element tree based on the dictionary first element group is displayed, and in the DimensionCombo1 component - the element tree based on the dictionary second element group.
See also: