<< Return to Main Index

< Return to Class Index

CGXGridCore::GetControl

virtual CGXControl* GetControl(ROWCOL nRow, ROWCOL nCol);

nRow

Specifies the row id.

nCol

Specifies the column id.

Return Value

A pointer to the CGXControl-object associated with the specified cell.

Remarks

Overridable method which returns a pointer to the CGXControl-object associated with the specified cell.

The method simply calls LookupStyleRowCol to obtain a reference to the cell-style.

The control-id is determined with CGXStyle::GetControl.

This id is passed to GetRegisteredControl, which returns a pointer to the associated control.

Example

This example illustrates a typical usage of the GetControl method.

// Reset edit-mode for current cell
ROWCOL nRow, nCol;
if (GetCurrentCell(nRow, nCol))
{
   CGXControl* pControl = GetControl(nRow, nCol);
   if (pControl->GetModify( ))
      pControl->Store( );
   pControl->SetActive(FALSE);
   pControl->Refresh( );
}

See Also

CGXGridCore::LookupStyleRowCol CGXGridCore::RegisterControl

CGXGridCore

Class Overview | Class Members