In ASP.NET Web applications, when clicking a List View record, a Detail View is displayed in view mode. However, the Edit Action is available, and you can use it to reload the Detail View in edit mode. This is the default behavior. In individual scenarios, you may need to invoke a Detail View directly in edit mode. This example demonstrates how to omit the display of a View in view mode for a particular object type. For details, refer to the How to: Display a Detail View Directly in Edit Mode in ASP.NET Applications topic in XAF documentation.
You must
log in
or
register
to leave comments
using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.ExpressApp;
using DevExpress.Persistent.BaseImpl;
using DevExpress.ExpressApp.Editors;
namespace DetailViewInEditModeExample.Module.Web.Controllers {
public class SwitchToEditModeDetailViewController : ViewController<DetailView> {
public SwitchToEditModeDetailViewController() {
TargetObjectType = typeof(Person);
}
protected override void OnActivated() {
base.OnActivated();
if (View.ViewEditMode == ViewEditMode.View) {
View.ViewEditMode = ViewEditMode.Edit;
}
}
}
}
Facebook
Twitter
Google+