CGXDaoGrid::OnInitColInfo
virtual void OnInitColInfo(ROWCOL nCol, const CDaoFieldInfo& fieldInfo, CString& strName, long& cbLength, WORD& wBaseStyle, BOOL* pbColumnSettingsLocked = NULL);?
nCol
Specifies the column id.
fieldInfo
A reference to a CDaoFieldInfo object which contains the information about the DAO field.
strName
A reference to a CString to receive the column title.
cbLength
A reference to a long to receive the display width of the column in characters.
wBaseStyle
A reference to a WORD to receive the base style id for the column.
pbColumnSettingsLocked
A pointer to a BOOL variable. See the remarks section for more information.
Remarks
Called from OpenRecordset to determine the default settings for columns based on their data types. The method associates the columns with a base style and determines the column title and width.
In the base class version of this method, cbLength is calculated with GetDisplaySize.
The method assigns the following base styles to the column depending on its data type:
- dbText: m_bsText
-
dbByte,
dbInteger,
dbLong,
dbSingle,
dbDouble: m_bsNumeric - dbBoolean: m_bsBoolean
- dbCurrency: m_bsCurrency
- dbDate: m_bsDate
- dbLongBinary: m_bsBinary
- dbMemo: m_bsMemo
ยทdbGUID: m_bsGUID
The CGXDaoParam class holds the base style ids.
Set *pbColumnSettingsLocked to TRUE if you do not want the calling routine to further change your settings. If *pbColumnSettingsLocked is FALSE or pbColumnSettingsLocked is NULL, OnOpenRecordSet will modify the column widht and headers. Note: Be sure to check for pbColumnSettingsLocked = NULL in your overrides.
See Also
CGXDaoGrid::GetDisplaySize CGXDaoGrid::OpenRecordset CGXDaoParam