vcl-dxmdaset-dot-tdxcustommemdata-ed5d5c9b.md
Specifies one or more fields against which the TdxMemData component sorts data.
property SortedFields: string read; write;
| Type | Description |
|---|---|
| string |
The delimited string of target dataset fields and sort syntax flags.
|
Use the SortedFields property to specify one or multiple dataset field names separated by semicolons to sort data. The order of listed field names defines the order in which multiple sort operations are processed.
The SortOptions property allows you to modify the behavior of sort operations for all dataset fields listed in the SortedFields property. The SortOptions property value can include the following flags in any combination:
The TdxMemData component sorts data against all listed fields in descending order, except for fields followed by a colon and the 'A' or 'a' sort order syntax flag.
If the flag is omitted, the component sorts data in ascending order, except for listed fields followed by a colon and the 'D' or 'd' sort syntax flag.
The TdxMemData component ignores character case for sort operations against all fields listed in the SortedFields property value.
If this flag is omitted, sort operations are case-sensitive, except for those fields followed by a colon and the 'N' or 'n' sort syntax flag.
The SortedFields property supports a number of syntax flags that allow you to customize sort operation settings for individual target fields. You can specify one or multiple syntax flags without delimiters after a field name followed by a colon.
The following code example sorts data against the CustomerName field in descending order without case sensitivity:
dxMemData1.SortedFields := 'CustomerName:DN';
dxMemData1->SortedFields = "CustomerName:DN";
'A' | 'a'The component sorts data in ascending order against the corresponding field.'D' | 'd'The component sorts data in descending order against the corresponding field.'N' | 'n'The sort operation against the corresponding field is case-insensitive.
The code example below defines a sort operation against CustomerName (in descending order), Quantity (in descending order), and UnitPrice (in ascending order) fields. The 'N' syntax flag defines case-insensitive sorting against the CustomerName field.
dxMemData1.SortedFields := 'CustomerName:DN;Quantity:D;UnitPrice:A';
dxMemData1->SortedFields = "CustomerName:DN;Quantity:D;UnitPrice:A";
You can use the SortedFields property’s editor dialog available at design time to preview and manage the list of sorted fields and their sort syntax flags. Click the ellipsis button to the right of the SortedFields property in the Object Inspector to invoke the dialog.
A click on the Add button invokes a pop-up menu populated with available field names that you can click to add or remove them to/from the SortedFields property value. Ascending , Descending , and Case Insensitive buttons manage sort syntax flags for a selected field. Move Down and Move Up buttons rearrange listed fields to change the order of sort operations.
The TdxMemData component does not support sort operations against calculated fields.
The SortedFields property’s default value is an empty string.
See Also