CGXGridCore::StoreMoveDataCols

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

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 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.

The default behavior of this method is to move the columns in the CGXData object.

The CGXBrowserGrid implementation will rearrange the column id array in the CGXBrowseParam object.

Override this method if you have attached the grid to your own data source.

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 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::MoveDataCols  CGXData::StoreMoveDataCols  CGXBrowseParam

CGXGridCore

 Class Overview |  Class Members