Skip to main content

DxGrid.DetailExpandButtonDisplayMode Property

Specifies when to display master-detail expand buttons.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(GridDetailExpandButtonDisplayMode.Auto)]
[Parameter]
public GridDetailExpandButtonDisplayMode DetailExpandButtonDisplayMode { get; set; }

Property Value

Type Default Description
GridDetailExpandButtonDisplayMode Auto

A GridDetailExpandButtonDisplayMode enumeration value.

Available values:

Name Description
Auto

Expand buttons are displayed when the DetailRowTemplate is specified.

Never

Expand buttons are always hidden.

Remarks

The Grid allows users to create master-detail layouts of any complexity. To enable this functionality, specify the DetailRowTemplate.

A user can click a data row’s expand/collapse button to change a detail row’s expansion state and show/hide detail data.

Grid - Collapse and Expand buttons

Use the DetailExpandButtonDisplayMode property to specify when to display master-detail expand buttons in the Grid. The default property value is Auto. The Grid shows expand buttons if the DetailRowTemplate is specified and the DetailRowDisplayMode is set to Auto. Otherwise, expand buttons are hidden.

The following example changes DetailExpandButtonDisplayMode to Never:

@inject NwindDataService NwindDataService

<DxGrid @ref="Grid" 
        Data="MasterGridData" 
        DetailExpandButtonDisplayMode="GridDetailExpandButtonDisplayMode.Never">
    <Columns>
        <DxGridDataColumn FieldName="ContactName" SortIndex="0" />
        <DxGridDataColumn FieldName="CompanyName" />
        <DxGridDataColumn FieldName="Country" />
        <DxGridDataColumn FieldName="City" />
    </Columns>
    <DetailRowTemplate>
        <Grid_MasterDetail_NestedGrid_DetailContent Customer="(Customer)context.DataItem" />
    </DetailRowTemplate>
</DxGrid>

@code {
    IGrid Grid { get; set; }
    object MasterGridData { get; set; }

    protected override async Task OnInitializedAsync() {
        MasterGridData = await NwindDataService.GetCustomersAsync();
    }
    protected override void OnAfterRender(bool firstRender) {
        if(firstRender) {
            Grid.ExpandDetailRow(0);
        }
    }
}

Grid - DetailExpandButtonDisplayMode Never

See Also