<< Return to Main Index

< Return to Class Index

CGXDBEGrid::GetColIndex

virtual ROWCOL GetColIndex(ROWCOL nCol);

nCol

Specifies the column id.

Return Value

A ROWCOL index for the row.

Remarks

GetColIndex returns the original column id for a given column. This original column id can be different from the given column when the column has been moved or the grid has been sorted.

GetColIndex is called to de-reference the index associated with the specified column. This method adds support for rearranging columns in the grid. The return value is one-based.

The base-class version retrieves the index from the m_awColIndex array maintained in the CGXDBEParam object.  This is sufficient for most cases, but in some special cases you may wish to maintain your personal index array or maybe even store the index-array in a file. You can support these special scenarios by overriding this method.

CGXDBEGrid also provides another method called GetFieldFromCol. GetFieldFromCol calls GetColIndex and converts the column id to a zero-based field index.

Delegates to CGXBrowserLayoutManager::GetColIndex.

See Also

CGXDBEGrid::GetFieldFromCol CGXDBEParam

CGXDBEGrid 

Class Overview | Class Members