Ascending: Boolean;
Ascending: boolean;
The Ascending property determines direction of the MDM dictionary elements sorting. If it is set to True, ascending sorting is performed.
Executing the example requires a form with the Button1 button, the RdsDictionaryBox1 component, and the UiRdsDictionary1 component that is a data source of the RdsDictionaryBox1 component. An MDM dictionary is connected to the UiRdsDictionary1 component via the Object property. Add links to the ExstCtrls, Forms, Metabase and Rds system assemblies.
The example is a handler of the OnClick event for the button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Dict: IRdsDictionaryInstance;
Attrs: IRdsAttributes;
SAttr: IRdsSortAttribute;
Sorter: IRdsElementsSorter;
Elems: IRdsDictionaryElements;
Begin
Dict := RdsDictionaryBox1.Source.Instance;
Elems := Dict.Elements;
Sorter := Elems.CreateSorter(Elems.Root);
Attrs := Dict.Dictionary.Attributes;
SAttr := Sorter.Attributes.Add(Attrs.FindById("Name"), True);
debug.WriteLine(SAttr.Attribute.Name);
debug.WriteLine(SAttr.Ascending);
Sorter.Sort(False);
RdsDictionaryBox1.RefreshElements;
End Sub Button1OnClick;
After executing the example, clicking the Button1 button sorts elements by the Name attribute and displays attribute name and sort direction in the console window.
Executing the example requires a form with the button1 button, the RdsDictionaryBoxNet1 component, and the UiRdsDictionaryNet1 component that is a data source of the RdsDictionaryBoxNet1 component. An MDM dictionary is connected to the UiRdsDictionaryNet1 component via the Object property. Add links to the Forms.NET, Forms and Rds system assemblies.
The example is a handler of the Click event for the button.
Imports Prognoz.Platform.Interop.Forms;
Imports Prognoz.Platform.Interop.Rds;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Dict: IRdsDictionaryInstance;
Attrs: IRdsAttributes;
SAttr: IRdsSortAttribute;
Sorter: IRdsElementsSorter;
Elems: IRdsDictionaryElements;
Begin
Dict := RdsDictionaryBoxNet1.Source.Instance;
Elems := Dict.Elements;
Sorter := Elems.CreateSorter(Elems.Root);
Attrs := Dict.Dictionary.Attributes;
SAttr := Sorter.Attributes.Add(Attrs.FindById("Name"), True);
System.Diagnostics.Debug.WriteLine(SAttr.Attribute.Name);
System.Diagnostics.Debug.WriteLine(SAttr.Ascending);
Sorter.Sort(False);
RdsDictionaryBoxNet1.CtrlBox.RefreshElements();
End Sub;
After executing the example, clicking the Button1 button sorts elements by the Name attribute and displays attribute name and sort direction in the console window.
See also: