<< Return to Main Index

< Return to Class Index

CGXGridCore::MoveDataRows

virtual BOOL MoveDataRows(const CGXRange& sortRange, const CRowColArray& awRowIndex, UINT flags = GX_UPDATENOW, GXCmdType ctCmd = gxDo);

sortRange

Specifies the range of cells to be sorted.

awRowIndex

An array with the new row order. Each entry in the array refers to the original row.

flags

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

MoveDataRows is called from SortRows to rearrange the rows in the grid. MoveDataRows will call the virtual method StoreMoveDataRows for changing the data structure and UpdateMoveDataRows for updating the display.

MoveDataRows generates a CGXMoveDataRowsCmd-object with undo-information. The user can undo sorting operations (unless you have overridden the default behavior).

Note: MoveDataRows will not be called for ODBC or DAO grids because, with these data sources, sorting is implemented in the SortRows method by requerying the data source with the SQL “order by” statement.

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::StoreMoveDataRows CGXGridCore::UpdateMoveDataRows CGXGridCore::SortRows

CGXGridCore

Class Overview | Class Members