<< Return to Main Index

< Return to Class Index

CGXGridCore::SetColWidth

virtual BOOL SetColWidth(ROWCOL nFromCol, ROWCOL nToCol, int nWidth, int* anWidthArray = NULL, UINT flags = GX_UPDATENOW, GXCmdType ctCmd = gxDo);

nFromCol

Specifies the first column id.

nToCol

Specifies the last column id.

nWidth

Specifies the width in pixels for all columns.

anWidthArray

An optional pointer to an array with the column-widths for the specified cells. If it is NULL, nWidth is used for all cells.

flags

Specifies the update technique. See UpdateChangeColWidths for more information.

ctCmd

Specifies if the executed command is undone (gxUndo), redone (gxRedo), executed the first time (gxDo) or rolled back (gxRollback).

Return Value

TRUE if the command has been successfully executed; it is FALSE if the command failed or if the user aborted the operation.

Remarks

Overridable command for specifying the column-widths for specific columns in pixels.

Note that row-heights and column-widths are stored internally with logical values. Pixel values depend on the zooming-factor and the font-size of the standard-style.

Columns widths are stored with a call to StoreColWidth for each column. The display is updated with UpdateChangedColWidths.

The command generates a CGXSetColWidthCmd-object with undo-information.

The user can abort the operation.

If nWidth is greater than 0 and anWidthArray is not NULL, the command fails with an assertion.

See Also

CGXGridCore::StoreColWidth CGXGridCore::UpdateChangedColWidths CGXGridCore::GetColWidth

CGXGridCore

Class Overview | Class Members