A newer version of this page is available. Switch to the current version.

ASPxGridListEditor.CreateCustomGridViewDataColumn Event

Occurs when the data column is created.

Namespace: DevExpress.ExpressApp.Web.Editors.ASPx

Assembly: DevExpress.ExpressApp.Web.v18.2.dll


public event EventHandler<CreateCustomGridViewDataColumnEventArgs> CreateCustomGridViewDataColumn
Public Event CreateCustomGridViewDataColumn As EventHandler(Of CreateCustomGridViewDataColumnEventArgs)

Event Data

The CreateCustomGridViewDataColumn event's data class is CreateCustomGridViewDataColumnEventArgs. The following properties provide information specific to this event:

Property Description
Column Specifies the data column.
GridViewDataColumnInfo Specifies the data column info.
ModelColumn Gets the Application Model settings of the column.


Handle the CreateCustomGridViewDataColumn event to create a custom data column. After creation, the Application Model settings are applied to the column. Additionally, the ASPxGridListEditor.CreateCustomDataItemTemplate and ASPxGridListEditor.CreateCustomEditItemTemplate are triggered if the GridViewDataColumn.DataItemTemplate and GridViewDataColumn.EditItemTemplate templates are not assigned.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Web.Editors.ASPx;
// ...
public class CreateCustomGridViewDataColumnController : ObjectViewController<ListView, Person> {
    protected override void OnActivated() {
        ASPxGridListEditor listEditor = (ASPxGridListEditor)View.Editor;
        listEditor.CreateCustomGridViewDataColumn += listEditor_CreateCustomGridViewDataColumn;
    private void listEditor_CreateCustomGridViewDataColumn(
        object sender, CreateCustomGridViewDataColumnEventArgs e) {
        // ...
    protected override void OnDeactivated() {
        ASPxGridListEditor listEditor = (ASPxGridListEditor)View.Editor;
        listEditor.CreateCustomGridViewDataColumn -= listEditor_CreateCustomGridViewDataColumn;

You should subscribe to this event before the View.ControlsCreated event occurs (e.g., in the overridden OnActivated method of a custom Controller). It is too late to customize columns when the grid control has already been created.

See Also