CGXGridCore::MoveDataCols
virtual BOOL MoveDataCols(const CGXRange& sortRange, const CRowColArray& awColIndex, UINT flags = GX_UPDATENOW, GXCmdType ctCmd = gxDo);
sortRange
Specifies the range of cells to be sorted.
awColIndex
An array with the new column order. Each entry in the array refers to the original column.
flags
-
Specifies the update technique:
- GX_UPDATENOW - updates the window immediately
GX_INVALIDATE - invalidates the window
ctCmd
Specifies if the executed command is undone (gxUndo), redone (gxRedo), executed the first time (gxDo) or rolled back (gxRollback).
Return Value
TRUE if the command was successful; FALSE otherwise.
Remarks
MoveDataCols is called from SortCols to rearrange the columns in the grid. MoveDataCols will call the virtual method StoreMoveDataCols for changing the data structure and UpdateMoveDataCols for updating the display.
MoveDataCols generates a CGXMoveDataColsCmd-object with undo-information. The user can undo sorting operations (unless you have overridden the default behavior).
Control-Factory Specific ->
This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the ImplementGridSort method from within the control factory class' InitializeGridComponents method will make the concrete implementation of this method available to your application.
If no concrete implementation is available this method returns FALSE. A warning will be displayed in the debug window.
END Control-Factory Specific
See Also
CGXGridCore::StoreMoveDataCols CGXGridCore::UpdateMoveDataCols CGXGridCore::SortCols