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.v24.1.dll
NuGet Package: DevExpress.ExpressApp.Web
Declaration
[DefaultValue(DetailRowMode.None)]
[ModelBrowsable(typeof(ModelListViewGridListEditorVisibilityCalculator))]
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 Web Forms project, and set the DetailRowMode property of the Views | <ListView> node to DetailView or to DetailViewWithActions.
In the DetailViewWithActions mode, a Detail View specified using the IModelListViewWeb.DetailRowView property is shown in a detail row.
In DetailView mode, the same Detail View is shown, but the toolbar of its nested List View is hidden.
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);
}
}
}