CGXGridCore::ComposeStyleRowCol

virtual void ComposeStyleRowCol(ROWCOL nRow, ROWCOL nCol, CGXStyle* pStyle, BOOL bApplyStandard = TRUE);

nRow

Specifies the row id.

nCol

Specifies the column id.

pStyle

A reference to a style-object to store the result.

bApplyStandard

Specifies if the standard-style should be loaded. If you specify not to load the standard-style, you are responsible for checking the include-bits of the style attributes you need.

Remarks

This method composes the style for the specified cell by inheriting all attributes from its base-styles.

Base-styles will be loaded in the following precedence:

1. Retrieve the specific cell style with:

GetStyleRowCol(nRow, nCol, *pStyle, gxCopy, 0);

2. Next, fill those attributes that have not yet been initialized with attributes from the base-styles:

2a) The base-style of the row.

GetStyleRowCol(nRow, 0, *pStyle, gxApplyNew, -1);

2b) The base-style of the column.

GetStyleRowCol(0, nCol, *pStyle, gxApplyNew, -1);

2c) The base-style of the table.

GetStyleRowCol(0, 0, *pStyle, gxApplyNew, -1);

3. Next, inherit attributes from the base-styles (specified with CGXStyle::SetBaseStyle( )).

4. If the specified cell is a row or column header, inherit attributes from row-header-style or column-header-style and initialize the value with a row-number (1,2,3...) or column-header (A,B,C,...).

5. If bApplyStandard is TRUE, inherit remaining attributes from the standard-style.

Example

This example illustrates how to loop through a range of cells and print each cell’s value:

ROWCOL nCol = 1;
CGXStyle style;
ROWCOL nCount = GetRowCount( );
for (ROWCOL nRow = 1; nRow <= nCount; nRow++)
{
   ComposeStyleRowCol(nRow, nCol, &style);
   TRACE("%lu: %s\n", nRow, (LPCTSTR) style.GetValueRef( ));
}

See Also

 CGXGridCore::GetStyleRowCol  CGXGridCore::LookupStyleRowCol  CGXGridCore::GetRowStyle  CGXGridCore::GetColStyle  CGXGridCore::GetTableStyle  CGXStyle::SetBaseStyle

CGXGridCore

 Class Overview |  Class Members