short GetFieldFromCol(ROWCOL nCol);
nCol
Specifies the column id.
A zero-based short index.
Returns the zero-based field index associated with a column. GetFieldFromCol calls GetColIndex and converts the column id to a zero-based field index.
If you override OnLoadCellStyle (or any other methods where you connect the grid to your data source), you should always take care to dereference the index associated with a column. This enables your application to support rearranging columns.
This sample code shows you how you can use this method to dereference the original field associated with a column:
// determine field index for the column
short nField = GetFieldFromCol(nCol);
// now, I can determine field information
CField* fld = GetDocument()->m_dbfile.GetField(nField);
CGXBrowserGrid::GetColIndex CGXBrowserGrid::OnLoadCellStyle
Class Overview | Class Members