## wxDbGridColInfo

This class is used to define columns to be shown, names of the columns, order and type of data, when using wxdbGridTableBase to display a Table or query in a wxGrid

See the database grid example in wxDbGridTableBase for an introduction to using the wxDbGrid classes.

Include files

<wx/dbgrid.h>

Members

wxDbGridColInfo::wxDbGridColInfo
wxDbGridColInfo::~wxDbGridColInfo
wxDbGridColInfo::AddColInfo

### wxDbGridColInfo::wxDbGridColInfo

wxDbGridColInfo(int colNumber, wxString type, wxString title, wxDbGridColInfo *next)

Default constructor. See the database grid example in wxDbGridTableBase to see two different ways for adding columns.

Parameters

colNumber

Column number in the wxDbTable instance to be used (first column is 0).

type

Column type ,wxString specifying the grid name for the datatype in this column, or use wxGRID_VALUE_DBAUTO to determine the type automatically from the wxDbColDef definition

title

The column label to be used in the grid display

next

A pointer to the next wxDbGridColInfo structure if using one-step construction, NULL terminates the list. Use Null also if using two step construction.

See the database grid example in wxDbGridTableBase to see two different ways for adding columns.

### wxDbGridColInfo::~wxDbGridColInfo

~wxDbGridColInfo()

Destructor.

### wxDbGridColInfo::AddColInfo

void AddColInfo(int colNumber, wxString type, wxString title)

Use this member function for adding columns. See the database grid example in wxDbGridTableBase to see two different ways for adding columns.

It is important to note that this class is merely a specifier to the wxDbGridTableBase constructor. Changes made to this datatype after the wxDbGridTableBase is called will not have any effect.

Parameters colNumber

Column number in the wxDbTable instance to be used (first column is 0).

type

Column type ,wxString specifying the grid name for the datatype in this column, or use wxGRID_VALUE_DBAUTO to determine the type automatically from the wxDbColDef definition

title

The column label to be used in the grid display

Remarks

As wxDbTable must be defined with to have columns which match those to by a wxDbGridColInfo info structure as this is the structure which informs the grid of how you want to display your wxDbTable. If no datatype conversion or the referenced column number does not exist the the behavior is undefined.

See the example at wxDbGridColInfo::wxDbGridColInfo.