<< Return to Main Index

< Return to Class Index

CGXAdoGrid::OnInitColInfo

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

nCol

Specifies the column id.

fieldInfo

A reference to an ADOFieldInfo 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, 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:

·adGUID: m_bsGUID

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

CGXAdoGrid::GetDisplaySize CGXAdoGrid::OpenRecordset CGXAdoParam

CGXAdoGrid

Class Overview | Class Members