

| Type | Description | |||
| Property as DefColumnEnum | A DefColumnEnum expression that indicates the property being changed. | |||
| Variant | A Variant value that specifies the newly value. |

The following VB sample adds a header row column:
With Grid1.Columns.Add("H")
.Def(exCellHasButton) = True
.Position = 0
.AllowDragging = False
.HeaderAlignment = CenterAlignment
.Width = 16
End With
The following VB sample assigns checkboxes for all cells in the first column:
Grid1.Columns(0).Def(exCellHasCheckBox) = True
The following C++ sample adds a header row column:
#include "Column.h"
#include "Columns.h"
CColumns columns = m_grid.GetColumns();
CColumn column( V_DISPATCH( &columns.Add("H") ) );
column.SetHeaderAlignment( 1 );
column.SetDef(2, COleVariant( VARIANT_TRUE ) );
column.SetPosition( 0 );
column.SetWidth( 16 );
column.SetAllowDragging( FALSE );
The following C++ sample assigns checkboxes for all cells in the first column:
COleVariant vtCheckBox( VARIANT_TRUE ); m_grid.GetColumns().GetItem( COleVariant( (long) 0 ) ).SetDef( /*exCellHasCheckBox*/ 0, vtCheckBox );
The following VB.NET sample adds a header row column:
With AxGrid1.Columns.Add("H")
.Def(EXGRIDLib.DefColumnEnum.exCellHasButton) = True
.Position = 0
.AllowDragging = False
.HeaderAlignment = EXGRIDLib.AlignmentEnum.CenterAlignment
.Width = 16
End With
The following VB.NET sample assigns checkboxes for all cells in the first column:
With AxGrid1.Columns(0)
.Def(EXGRIDLib.DefColumnEnum.exCellHasCheckBox) = True
End With
The following C# sample adds a header row column:
EXGRIDLib.Columns columns = axGrid1.Columns;
EXGRIDLib.Column column = columns.Add("H") as EXGRIDLib.Column;
column.set_Def(EXGRIDLib.DefColumnEnum.exCellHasButton, true);
column.Position = 0;
column.HeaderAlignment = EXGRIDLib.AlignmentEnum.CenterAlignment;
column.AllowDragging = false;
column.Width = 16;
The following C# sample assigns checkboxes for all cells in the first column:
axGrid1.Columns[0].set_Def( EXGRIDLib.DefColumnEnum.exCellHasCheckBox, true );
The following VFP sample adds a header row column:
with thisform.Grid1.Columns.Add("H")
.Position = 0
.Def(2) = .t.
.AllowDragging = .f.
.Width = 16
endwith
The following VFP sample assigns checkboxes for all cells in the first column:
with thisform.Grid1.Columns(0) .Def( 0 ) = .t. endwith