Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

WinColumnsListEditor.CustomizeGridColumn Event

Occurs when a column is created.

Namespace: DevExpress.ExpressApp.Win.Editors

Assembly: DevExpress.ExpressApp.Win.v20.2.dll

NuGet Package: DevExpress.ExpressApp.Win

Declaration

public event EventHandler<CustomizeGridColumnEventArgs> CustomizeGridColumn

Event Data

The CustomizeGridColumn event's data class is DevExpress.ExpressApp.Win.Editors.CustomizeGridColumnEventArgs.

Remarks

Handle this event to customize column settings. Use the e.GridColumn parameter to access the column instance. The following example demonstrates the Controller that handles the CustomizeGridColumn event and makes the FullName column of the Contact object’s List View fixed.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win.Editors;
// ...
public class CustomizeGridColumnController : ObjectViewController<ListView, Contact> {
    protected override void OnActivated() {
        base.OnActivated();
        GridListEditor listEditor = ((ListView)View).Editor as GridListEditor;
        if (listEditor != null) {
            listEditor.CustomizeGridColumn += listEditor_CustomizeGridColumn;
        }
    }
    void listEditor_CustomizeGridColumn(object sender, CustomizeGridColumnEventArgs e) {
        if (e.GridColumn.FieldName == "FullName") {
            e.GridColumn.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;
        }
    }
}

Important

Subscribe to CustomizeGridColumn in the overridden OnActivated method. Do not use the OnViewControlsCreated method for this purpose - columns are already initialized at that moment and the event will not be triggered.

See Also