<< Return to Main Index

< Return to Class Index

CGXGridCore::LookupStyleRowCol

virtual const CGXStyle& LookupStyleRowCol(ROWCOL nRow, ROWCOL nCol);

nRow

Specifies the row id.

nCol

Specifies the column id.

Return Value

Returns a reference to a style-object internally stored in a cache.

Remarks

This advanced method retrieves the full style for the specified cell inheriting all attributes from its base styles by calling ComposeStyleRowCol.

Please note that the method returns a reference to a temporary style-object being stored in a cache. OnGridDraw empties the cache by calling FreeObjectCache.

Example

This example illustrates how to determine if the font for the current cell is set to Bold.

ROWCOL nRow, nCol;
BOOL bIsBold = FALSE;
if (GetCurrentCell(nRow, nCol))
{
   const CGXStyle& style = LookupStyleRowCol(nRow, nCol);

   // Cell-specific style, e.g. RTF will set font and textcolor
   // attributes of the current selection
   CGXControl* pControl = GetRegisteredControl(style.GetControl());
   pControl->LoadStyle(nRow, nCol, &style);

   bIsBold = style.IsSubSet(
      CGXStyle( ).SetFont(
         CGXFont( ).SetBold(TRUE)
      ));
}

See Also

CGXGridCore::GetStyleRowCol CGXGridCore::ComposeStyleRowCol CGXGridCore::FreeObjectCache

CGXGridCore

Class Overview | Class Members