CGXBrowserGrid::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 dereference 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 CGXBrowseParam 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.
CGXBrowserGrid also provides another method called GetFieldFromCol. GetFieldFromCol calls GetColIndex and converts the column id to a zero-based field index.
See Also
CGXBrowserGrid::GetFieldFromCol CGXBrowseParam