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

 TypeDescription 
   Column as Column A Column object that's added to the Columns collection.  

The control fires the AddColumn event is fired when a new column is inserted to the Columns collection. Use the AddColumn event to associate any extra data to the column. Use the Add method to add a new column. Use the Add, PutItems or DataSource method to add new items to the control. Use the ColumnAutoResize property to allow visible columns fit the control's client area.

The following VB sample sets the width for all columns:

Private Sub List1_AddColumn(ByVal Column As EXLISTLibCtl.IColumn)
    Column.Width = 128
End Sub

The following C++ sample changes the column's width when a new column is added:

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

The following VB.NET sample  changes the column's width when a new column is added:

Private Sub AxList1_AddColumn(ByVal sender As Object, ByVal e As AxEXLISTLib._IListEvents_AddColumnEvent) Handles AxList1.AddColumn
    e.column.Width = 128
End Sub

The following C# sample changes the column's width when a new column is added:

private void axList1_AddColumn(object sender, AxEXLISTLib._IListEvents_AddColumnEvent e)
{
	e.column.Width = 128;
}

The following VFP sample changes the column's width when a new column is added:

*** ActiveX Control Event ***
LPARAMETERS column

with column
	.Width = 128
endwith

 


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