<< Return to Main Index

< Return to Class Index

CGXGridCore::GetRowHeight

virtual int GetRowHeight(ROWCOL nRow);

nRow

Specifies the row id.

Return Value

Returns the row-height in pixels. If it is 0, the column is hidden.

Remarks

Overridable method which returns the row-height in pixels.

Note that this value is computed from an internally stored logical height that considers the font-size of the standard-style and the zooming-factor.

Height_LPtoDP helps you convert from logical to pixel values when you override this method. You should also consider calling IsRowHidden to ensure that you return 0 for hidden rows.

Note

The base-class version of this method will limit the cell size so it is not larger than the grid height. If you want cells can to be larger than the grid, you should set the attribute m_bLimitRowHeight = FALSE.

Example

This example illustrates overriding GetRowHeight.

int TheDerivedGridClass::GetRowHeight(ROWCOL nRow)
{
   if (IsRowHidden(nRow))
      return 0;
   else if (GetDocument->RowHeightArray[nRow] < 0)
      return GetDefaultRowHeight( );
   return Height_LPtoDP(GetDocument->RowHeightArray[nRow]);
}

See Also

CGXGridCore::SetRowHeight CGXGridCore::IsRowHidden CGXGridCore::Height_LPtoDP

CGXGridCore

Class Overview | Class Members