Back to Devexpress

GridViewSettings.CommandButtonInitialize Property

aspnetmvc-devexpress-dot-web-dot-mvc-dot-gridviewsettings-bc53f500.md

latest1.8 KB
Original Source

GridViewSettings.CommandButtonInitialize Property

Enables individual row cells containing command column items to be initialized.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public ASPxGridViewCommandButtonEventHandler CommandButtonInitialize { get; set; }
vb
Public Property CommandButtonInitialize As ASPxGridViewCommandButtonEventHandler

Property Value

TypeDescription
ASPxGridViewCommandButtonEventHandler

A ASPxGridViewCommandButtonEventHandler delegate method allowing you to implement custom processing.

|

Remarks

csharp
settings.CommandButtonInitialize = (sender, e) => {  
    var grd = sender as MVCxGridView;  
    if (e.ButtonType == ColumnCommandButtonType.Delete) {  
        var val = grd.GetRowValues(e.VisibleIndex, ...);  
        e.Visible = !(bool)val;  
    }  
};

See Also

Declaring Server-Side Event Handlers

Grid View

GridViewSettings Class

GridViewSettings Members

DevExpress.Web.Mvc Namespace