bOk = MTblSortTree( hWndTbl, nSortFlags )

Sorts a table by row hierarchy.

Parameters
hWndTbl
Window Handle: Handle of the table

nSortFlags
Number: Sort flags. Specify one of the following constants:

MTST_TOPDOWN

Child rows appear below parent rows

MTST_BOTTOMUP

Child rows appear above parent rows

Return
Boolean: TRUE if successful or FALSE if an error occurs

Example
In this example a table is sorted topdown:

Set nSortFlags = MTST_TOPDOWN
Call MTblSortTree( hWndTbl, nSortFlags )

Remarks
This function is very useful to restore the hierarchical structure after sorting a table.
Split rows are not supported.
Child rows are sorted so that they are always outside merged rows.
If the function succeeds, depending on the sort order the tree order flag MTBL_TREE_FLAG_BOTTOM_UP is set or cleared.

See also
Tree view
Extended sorting

Created with the Personal Edition of HelpNDoc: Free CHM Help documentation generator