- Sorting the columns (AAF)
- Simple sort
- Multiple sort
- Remember sorts
- Development and programming
AAF: Sort on the columns of a Table control
WINDEV allows the user to easily sort the columns of a Table control.
The sorts can also be performed through programming.
Remark: These operations can also be performed on a TreeView Table control.
Sorting the columns (AAF)
To sort the columns of a Table control, the user must click the title of the column.
The sortable columns are identified by a double arrow.
When the sort is enabled, a small arrow indicates the sort direction for the column.
Tip: To implement this feature, "Sortable" must be checked in the "General" tab of the description window of column.
To sort the content of a Table control on several columns, the user must:
- Hold the Ctrl key down.
- Click the title of columns that will be taken into account for the sort. The columns must be selected according to the requested order. For example, to sort by company and by name, you must click the "Company" column and then the "Name" column.
Remark: The multiple sort is available for the memory Table controls only.
When one or more sorts have been performed by the user on the columns of a Table control, these sorts can be stored in order for these sorts to be applied by default.
To enable this feature, you must:
- Open the context menu of the sort column of the Table control. For more details, see Context menu of columns.
- Select "Store the sorts".
Development and programming
When creating a Table control
To make a column sortable, all you have to do is select "Sortable" in the "General" tab of the description window of the column.
- To sort the content of a Table control, all you have to do is use TableSort.
- TableSortedColumn returns the list of sorted columns in the Table control.
- The StoreSortAAF property is used to determine and specify if the sorting order defined by the user on a Table or TreeView Table control is kept when an application is closed and opened again.
- The SortOption property is used to get and change the sorting options in the columns of a Table control.
- The Sortable property is used to know whether a column is sortable and to columns sortable.
- If you don't want to show the "Remember filters" and "Remember sorts" options in the context menu, simply use AAFDisable (or DisableAAF) with the aafSaveFilterAndSort constant.