event AddColumn (Column as Column)
Fired after a new column has been added.

 TypeDescription 
   Column as Column A Column object being inserted to the Columns collection.  

Use the AddColumn event to notify your application that a new column has been added. Use Add method to add new columns to the control. The AddColumn event is called even if the user binds the control to an ADO recordset using DataSource property. Use the Def property to specify default values for certain properties of a Column object. Use the AddColumn property to associate extra data to columns being added. The ColumnAutoResize property specifies whether the columns fit the control's client area. Use the Width property to specify the column's width.

The following VB sample changes the column's width, when adding the column:

Private Sub Grid1_AddColumn(ByVal Column As EXGRIDLibCtl.IColumn)
    Column.Width = 128
End Sub

The following C++ sample changes the column's width:

#include "Column.h"
void OnAddColumnGrid1(LPDISPATCH Column) 
{
	CColumn column( Column );column.m_bAutoRelease = FALSE;
	column.SetWidth( 128 );
}

The following VB.NET sample changes the column's width:

Private Sub AxGrid1_AddColumn(ByVal sender As Object, ByVal e As AxEXGRIDLib._IGridEvents_AddColumnEvent) Handles AxGrid1.AddColumn
    e.column.Width = 128
End Sub

The following C# sample changes the column's width:

private void axGrid1_AddColumn(object sender, AxEXGRIDLib._IGridEvents_AddColumnEvent e)
{
	e.column.Width = 128;
}

The following VFP sample changes the column's width:

*** ActiveX Control Event ***
LPARAMETERS column

with column
	.Width = 128
endwith
 

Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.