The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
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.
.NET Core 3.0+
The page you are viewing does not exist in the .NET Core 3.0+ platform documentation. This link will take you to the parent topic of the current section.

IModelListViewWeb.DetailRowMode Property

Specifies how the Detail Row is displayed in the current List View's ASPxGridListEditor.

Namespace: DevExpress.ExpressApp.Web.SystemModule

Assembly: DevExpress.ExpressApp.Web.v19.2.dll

Declaration

[ModelBrowsable(typeof(ModelListViewGridListEditorVisibilityCalculator))]
[DefaultValue(DetailRowMode.None)]
DetailRowMode DetailRowMode { get; set; }
<ModelBrowsable(GetType(ModelListViewGridListEditorVisibilityCalculator))>
<DefaultValue(DetailRowMode.None)>
Property DetailRowMode As DetailRowMode

Property Value

Type Default Description
DetailRowMode

None

A DetailRowMode enumeration value specifying how the detail row is displayed.

Remarks

This property has effect when the IModelListView.EditorType property of the current ListView node is set to ASPxGridListEditor and the View.AllowEdit property is set to false.

ASPxGridListEditor supports the master-detail data presentation. To enable it, run the Model Editor for an ASP.NET project, and set the DetailRowMode property of the Views | <ListView> node to DetailView or to DetailViewWithActions.

DetailRowMode

In the DetailViewWithActions mode, a Detail View specified using the IModelListViewWeb.DetailRowView property is shown in a detail row.

DetailRowMode_WithActions

In DetailView mode, the same Detail View is shown, but the toolbar of its nested List View is hidden.

DetailRowMode_Web

By default, DetailRowMode is None and the detail row is disabled.

If you edit a record using the Edit Action and then click Save and Close, the expanded row position is not saved (all rows are collapsed). You can restore the expanded row position using the following Controller:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Web.Editors.ASPx;
// ...
public class RestoreExpandedRowController : ViewController<ListView> {
    private int expandedIndex = 0;
    public RestoreExpandedRowController() {
        TargetViewId = "Project_ListView";
    }
    protected override void OnViewControlsCreated() {
        base.OnViewControlsCreated();
        DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridListEditor editor = View.Editor as ASPxGridListEditor;
        editor.Grid.DataBound += Grid_DataBound;
    }
    protected override void OnDeactivated() {
        DevExpress.ExpressApp.Web.Editors.ASPx.ASPxGridListEditor editor = View.Editor as ASPxGridListEditor;
        expandedIndex = -1;
        for (Int32 i = 0; i < editor.Grid.VisibleRowCount; i++) {
            if (editor.Grid.DetailRows.IsVisible(i)) {
                expandedIndex = i;
            }
        }
        editor.Grid.DataBound -= Grid_DataBound;
        base.OnDeactivated();
    }
    private void Grid_DataBound(object sender, EventArgs e) {
        if (expandedIndex != -1) {
            ((DevExpress.Web.ASPxGridView)sender).DetailRows.ExpandRow(expandedIndex);
        }
    }
}
See Also