Skip to main content

GridDetailRowDisplayMode Enum

Lists values that specify when to display detail rows in the Grid.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public enum GridDetailRowDisplayMode

Members

Name Description
Auto

Detail rows are visible if the corresponding master row is expanded.

Never

Detail rows are always hidden. Users cannot expand these rows.

Always

Detail rows display preview sections under each Grid data row across all columns. These sections can display any content, including tables, values from data source fields, custom text, etc. Users cannot collapse detail rows.

Remarks

Use the DetailRowDisplayMode property to specify when to display detail rows in the Grid. The default property value is Auto. The Grid shows detail rows if the corresponding master rows are expanded. Otherwise, detail rows are hidden.

Run Demo: Grid Master-Detail View - Nested Grid

Grid - DetailRowDisplayMode Auto

The following example changes DetailRowDisplayMode to Always:

@inject NwindDataService NwindDataService

<DxGrid @ref="Grid" Data="MasterGridData" DetailRowDisplayMode="GridDetailRowDisplayMode.Always">
    <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 - DetailRowDisplayMode Row Preview

Run Demo: Grid Master-Detail View - Row Preview

See Also