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+
.NET Core 3.0+

View.CurrentObject Property

Specifies a View's current object.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

public virtual object CurrentObject { get; set; }
Public Overridable Property CurrentObject As Object
public virtual object CurrentObject { get; set; }
Public Overridable Property CurrentObject As Object
public virtual object CurrentObject { get; set; }
Public Overridable Property CurrentObject As Object

Property Value

Type Description
Object

An object representing the current View's current object.

Property Value

Type Description
Object

An object representing the current View's current object.

Property Value

Type Description
Object

An object representing the current View's current object.

Remarks

The example below demonstrates how to set a Contact's FirstName value to the NickName property via a SimpleAction.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
using MainDemo.Module.BusinessObjects;
// ...
public class SetNickNameController : ViewController {
    public SetNickNameController() {
        SimpleAction setNickNameAction = new SimpleAction(this, "SetNickName", PredefinedCategory.Edit);
        setNickNameAction.Execute += SetNickNameAction_Execute;
    }
    private void SetNickNameAction_Execute(object sender, SimpleActionExecuteEventArgs e) {
        Contact currentObject = View.CurrentObject as Contact;
        if(currentObject != null) {
            currentObject.NickName = currentObject.FirstName;
        }
    }
}

This property returns null and is intended to be overridden in View descendants. See ListView.CurrentObject and DetailView.CurrentObject.

For additional information, refer to the How to: Access Objects Selected in the Current View help topic.

See Also