CGXGridCore::HideCols

virtual BOOL HideCols(ROWCOL nFromCol, ROWCOL nToCol, BOOL bHide = TRUE, BOOL* abHideArray = NULL, UINT flags = GX_UPDATENOW, GXCmdType ctCmd = gxDo);

nFromCol

Specifies the first column.

nToCol

Specifies the last column.

bHide

Specifies the visible-flag for all columns.

abHideArray

An optional pointer to an array with the visible-flags for the specified columns. If it is NULL, bHide is used for all columns.

flags

Specifies the update technique. See UpdateChangedColHeights 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 visible-flag for specific columns.

Visible-flags are stored with a call to StoreHideCol for each column. The display is updated with UpdateChangedColWidths.

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

The user can abort the operation.

When the user tracks the size of a column to zero, the column will be hidden. If the user double-clicks on the grid-line of a hidden column or resizes the column using the special cursor, the column will be restored.

To prevent the user from resizing hidden columns, override OnTrackColWidth. Check for IsColHidden() and return FALSE when the column is hidden (IsColHidden returns TRUE).

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 ImplementHideCells 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::StoreHideCol  CGXGridCore::IsColHidden   CGXGridCore::UpdateChangedColWidths  CGXGridCore::LockUpdate

CGXGridCore

 Class Overview |  Class Members