<< Return to Main Index

< Return to Class Index

CGXData::StoreMoveDataRows

virtual BOOL StoreMoveDataRows(const CGXRange& sortRange, const CRowColArray& awRowIndex);

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. Each entry in the array refers to the original row within sortRange.

Return Value

TRUE if rows could be rearranged; FALSE if it failed.

Remarks

This virtual method is called to rearrange the rows in the grid. The new order of rows is specified through the awRowIndex array.

Typically this function will be called from CGXGridCore::SortRows for rearranging the rows after the new sort order has been determined.

To get the original row id in the grid when looping through awRowIndex you have to add sortRange.top, e.g.

      for (int nDest = 0; nDest < anRowIndex.GetSize(); nDest++)
      {
         int nSrc = (int) (anRowIndex[nDest]+sortRange.top);

         // move data from nSrc to nDest
         // ...
      }

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 CGXData::ImplementSortMoveData method from within the control factory class' InitializeApplicationComponents 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::MoveDataRows CGXGridCore::StoreMoveDataRows CGXGridCore::SortRows

CGXData

Class Overview | Class Members