Skip to main content
.NET 6.0+

ViewItem.View Property

Specifies the Detail View that contains the current View Item.

Namespace: DevExpress.ExpressApp.Editors

Assembly: DevExpress.ExpressApp.v23.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public CompositeView View { get; set; }

Property Value

Type Description
CompositeView

A CompositeView object representing the Detail View where the current View Item is created.

Remarks

Use this property to access the current View Item’s Detail View. The following code snippet demonstrates how to do this:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Editors;
// ...
public class MyViewController : ViewController<DetailView> {
    protected override void OnActivated() {
        base.OnActivated();
        ViewItem viewItem = View.FindItem("FirstName");
        DetailView detailView = (DetailView)viewItem.View;
    }
    // ...
}

For instance, the ViewItem.Control‘s properties can be specified dependent on the View’s settings; or you can get the View’s View.ObjectSpace.

The View property is initialized in Detail Views only. If the current View Item is a Property Editor in an editable List View, is necessary to implement the IGridInplaceEdit interface in the underlying control to access the currently edited row. GridListEditor automatically assigns the IGridInplaceEdit.GridEditingObject property when the inplace editor is shown. In other List Editors, you should manually handle corresponding control events to set the GridEditingObject property when an editor control is being shown. Built-in Property Editors that support this mechanism are LookupPropertyEditor, ObjectPropertyEditor, PopupCriteriaPropertyEditor and ExpressionPropertyEditor.

See Also