Back to Devexpress

GridViewSettings.DetailRowGetButtonVisibility Property

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

latest2.1 KB
Original Source

GridViewSettings.DetailRowGetButtonVisibility Property

Enables you to hide/show expand buttons displayed within individual data rows.

Namespace : DevExpress.Web.Mvc

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

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public ASPxGridViewDetailRowButtonEventHandler DetailRowGetButtonVisibility { get; set; }
vb
Public Property DetailRowGetButtonVisibility As ASPxGridViewDetailRowButtonEventHandler

Property Value

TypeDescription
ASPxGridViewDetailRowButtonEventHandler

A delegate method that allows you to implement custom processing.

|

Remarks

The grid fires the DetailRowGetButtonVisibility delegate property for each data row. It allows you to hide/show the expand buttons for an individual data row. For example, you can hide expand buttons for data rows whose details have no data.

csharp
settings.DetailRowGetButtonVisibility += (sender, args) => {  
    var detailRowHandlerGrid = (MVCxGridView)sender;  
    var value = detailRowHandlerGrid.GetRowValuesByKeyValue(args.KeyValue, "YourFieldName");  
    if (value == somevalue)  
        args.ButtonState = GridViewDetailRowButtonState.Hidden;  
};

Note

The grid does not raise the DetailRowGetButtonVisibility delegate property if the ASPxGridViewDetailSettings.ShowDetailButtons option is set to False.

See Also

GridViewSettings Class

GridViewSettings Members

DevExpress.Web.Mvc Namespace