<< Return to Main Index

< Return to Class Index

CGXODBCGrid::OnInitColInfo

virtual void OnInitColInfo(ROWCOL nCol, const CGXFieldInfo& fieldInfo, CString& strName, long& cbLength, WORD& wBaseStyle, BOOL* pbColumnSettingsLocked = NULL)??

nCol

Specifies the column id.

fieldInfo

A reference to a CGXFieldInfo object which contains the information about the ODBC 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, 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:

·AFX_RFX_BOOL: m_bsBoolean

·AFX_RFX_BYTE,
AFX_RFX_INT,
AFX_RFX_SINGLE,
AFX_RFX_DOUBLE: m_bsNumeric

·AFX_RFX_DATE: m_bsDate

·AFX_RFX_TEXT: m_bsText

·AFX_RFX_LONGBINARY, AFX_RFX_BINARY: m_bsBinary

The CGXDbParam 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

CGXODBCGrid::GetDisplaySize CGXODBCGrid::OpenRecordset CGXDbParam

CGXODBCGrid

Class Overview | Class Members