<< Return to Main Index

< Return to Class Index

CGXGridCore::SetRangeName

virtual BOOL SetRangeName(LPCTSTR name, const CGXRange& rg, CObject* pUndoInfo = NULL, UINT flags = GX_UPDATENOW, GXCmdType ctCmd = gxDo);

name

Specifies the name of the range.

rg

Specifies the range.

pUndoInfo

A pointer to an object with an undo info generated from a previous DeleteRangeName call (when the user is undoing a DeleteRangeName command). You should only pass a NULL pointer.

flags

Specifies the update technique. This flag is passed to Redraw. See Redraw 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 range could be added to named ranges list; FALSE otherwise.

Remarks

Adds a named range or replaces an existing named range with the new range settings. The command can be undone.

This function has no effect if you did not enable the the formula engine.

Example:

         SetRangeName(_T("number"), CGXRange(6,1,10,4));

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

CGXFormulaSheet::SetRangeName

CGXGridCore

Class Overview | Class Members