SortAttribute: String;
The SortAttribute property determines the attribute used for sorting.
NOTE. This property is considered only if the IMetaAttributeSetting.SortType property is set to ControlSortType.Custom.
Executing the example requires a form, a button on this form and the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. The MetaAttributesBreadcrumb component is connected to the time series database.
At least one attribute should be selected in the MetaAttributesBreadcrumb component. The example is executed on clicking the button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Items: IBreadcrumbItems;
Item: IMetaAttributeBreadcrumbItem;
AttSett: IMetaAttributeSettings;
Attr: IMetaAttribute;
Sett: IMetaAttributeSetting;
Begin
Items := MetaAttributesBreadcrumb1.Items;
Item := Items.Item(0) As IMetaAttributeBreadcrumbItem;
AttSett := MetaAttributesBreadcrumb1.MetaAttributeSettings;
Attr := Item.MetaAttribute;
Sett := AttSett.FindByAttribute(Attr);
Sett.SortType := ControlSortType.Custom;
Sett.SortDirectionType := SortDirection.Ascending;
Sett.SortAttribute := "KEY";
End Sub Button1OnClick;
After executing the example elements of the first attribute selected in MetaAttributesBreadcrumb are sorted by the KEY attribute in ascending order.
See also: