Skip to main content
A newer version of this page is available. .

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.v18.2.dll

Declaration

[ModelBrowsable(typeof(ModelListViewGridListEditorVisibilityCalculator))]
[DefaultValue(DetailRowMode.None)]
DetailRowMode DetailRowMode { get; set; }

Property Value

Type Default Description
DetailRowMode **None**

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

Available values:

Name Description
None

The detail row is disabled.

DetailView

A Detail View specified using the IModelListViewWeb.DetailRowView property is shown in a detail row. The Nested List View’s Actions are hidden.

DetailViewWithActions

The Detail View specified using the IModelListViewWeb.DetailRowView property is shown in a detail row. The Nested List View’s Actions are visible.

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