BCGSuite for MFC
virtual void CBCGPDBGridCtrl::Sort ( int  nColumn,
BOOL  bAscending = TRUE,

Sorts the grid data.

Use this method to sort the grid.

If IsDBSort returns TRUE, the default implementation builds an SQL statement, clears the grid data, executes the statement and fills the grid control with records returned in the specified order.

Override this method in a derived class for custom sorting.

nColumnThe index of column to sort by.
bAscendingIf TRUE, the sort will be ascending.
bAddIf TRUE, the grid should work in "multiple sort mode" and the specified column will be added to the list of columns to sort by. If FALSE, the grid will be sorted only by specified column.

Reimplemented from CBCGPGridCtrl.