Sort property editor

This is a feature of JBuilder Professional and Enterprise.

To display this dialog, select the sort property in the Inspector when a DataSet component (such as a QueryDataSet) is highlighted in the structure pane. The property values contained in this dialog are stored in the SortDescriptor object.

The Sort property editor is used to specify properties that affect the order in which data is accessed and displayed. If no specific sort properties are set, data will be displayed in the order it was added to the table.

For more information on sorting data in a data set, see the Database Application Developer's Guide topic "Sorting data".

Available Columns

Displays the DataSet columns that are available to use for sorting the data. Select a column from this list then click the Add To Sort button to sort a data set by that column.

Add To Sort

Adds the column selected in the Available Columns list box to the Sorted Columns list.

Sorted Columns

Displays the columns and sort order that will be used to sort the data in the DataSet. To add a column to this list, select the column in the Available Columns list, then select Add To Sort. To remove a column from this list, select the column in the Column Names field, then select Remove From Sort.

Column Name

The name of the column on which to sort.

Descending

When checked, the data in the that column is sorted in descending (Z..A, or by locale) order. When unchecked, data is sorted in ascending (A..Z, or by locale) order.

Remove From Sort

Removes the column highlighted in the Column Name list from the sort specification. When removed, the data will be resorted by the new sort criteria, if specified, or revert to its default sort order.

Case Insensitive

Ignores whether characters are upper- or lower-case when sorting. This option applies to all selected columns.

Sort As Inserted

Select this option to remove all other sort criteria, and to sort the records by record number, in the order they were inserted into the database.

Index Name

Enter a name in this field to create a named index. This is the user-specified name to be associated with the sort specification (index) being defined in the dialog. See the Database Application Developer's Guide topic "Understanding sorting and indexing" for more information on index names.

Unique

Check the Unique option to create a unique index, which enables a "constraint" on the data in the StorageDataSet - only rows with unique values for the columns defined as sortKeys in the SortDescriptor can be added or updated in a DataSet.

Unique is a constraint on the data set, not just on the index. If you define a unique index on a column, you are asserting that no two rows in the data set have the same value in that column. If there are two or more rows in the data set that have the same value in the unique column when the index is first created, any duplicate rows are moved to a "duplicates" data set.

See the Database Application Developer's Guide topic "Understanding sorting and indexing" for more information on the Unique option.