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

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

The CGXBrowserGrid implementation will update the row id array in the CGXBrowseParam object.

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

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 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::MoveDataRows  CGXData::StoreMoveDataRows  CGXBrowseParam

CGXGridCore

 Class Overview |  Class Members