Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

The data sorting is performed by the CExtGridWnd::GridSortOrderSetup virtual method, which either sets new sorting rules or modifies the current rules. For example, the following code snippet sets ascending order for the first column:

CExtGridDataSortOrder gdsoColumns;
CExtGridDataSortOrder::ITEM_INFO _soii( 
0, // sort first column
true // true - ascending sort order, false - descending
); gdsoColumns.m_arrItems.Add( _soii ); m_wndGrid.GridSortOrderSetup(
false, // true - sort colums, false - sort rows
false, // invert sort order