<< Return to Main Index

< Return to Class Index

CGXData::StoreMoveDataCols

virtual BOOL StoreMoveDataCols(const CGXRange& sortRange, const CRowColArray& awColIndex);

sortRange

Specifies the range of cells to be rearranged.

awColIndex

An array with the new column order. Each entry in the array refers to the original column within sortRange.

Return Value

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

Remarks

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

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

To get the original column id in the grid when looping through awColIndex you have to add sortRange.left, e.g.

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

         // 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::MoveDataCols CGXGridCore::StoreMoveDataCols CGXGridCore::SortCols

CGXData

Class Overview | Class Members