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 de-reference the index associated with a column. This enables your application to support rearranging columns.
Delegates to CGXBrowserLayoutManager::GetFieldFromCol.
This sample code shows you how you can use this method to de-reference 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);
CGXDBEGrid::GetColIndex CGXDBEGrid::OnLoadCellStyle
Class Overview | Class Members