<< Return to Main Index

< Return to Class Index

CGXGridCore::GetRegisteredControl

CGXControl* GetRegisteredControl(WORD  nID);

nID

A unique Identifier for the control. This id should be a String-Resource-Id where you can specify the control name.

Return Value

Returns a pointer to the associated control-object.

Remarks

Normally, this function is called by GetControl to obtain a pointer to the cell’s control-object.

Each grid-object maintains a map with registered controls. A control must be an object derived from CGXControl. The registration of controls should be done in OnInitialUpdate by calling RegisterControl.

Example

This is the source code for GetControl:

CGXControl* CGXGridCore::GetControl(ROWCOL nRow, ROWCOL nCol)
{
   const CGXStyle& style = LookupStyleRowCol(nRow, nCol);

   return GetRegisteredControl(style.GetControl( ));
}

See Also

CGXGridCore::RegisterControl

CGXGridCore

Class Overview | Class Members