Datasheet::SwapColumns

Contents

Description

Swap two columns in Worksheet or Matrixsheet

Syntax

BOOL SwapColumns( int nRight, int nLeft, BOOL bUndo = FALSE )

Parameters

nRight
[input] A column is to be exchanged with the column nLeft
nLeft
[input] A column is to be exchanged with the column nRight
bUndo
[input] Whether to support undo(TRUE) or not (FALSE). default is FALSE

Return

TRUE if success, otherwise FALSE

Examples

EX1

// Reverse the column order in the active worksheet
void Datasheet_SwapColumns_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        for(int ii = 1; ii <= wks.GetNumCols() / 2 ; ii++)
            wks.SwapColumns(ii - 1, wks.GetNumCols() - ii);
    }
}

Remark

See Also

Datasheet::MoveColumns

header to Include

origin.h