Current filter:
                                You should refresh the page.

                                How to Display a Detail View Directly in Edit Mode in ASP.NET Applications

                                0

                                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
                                Select file
                                • SwitchToEditModeDetailViewController.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2012 vol 2.4 - v2012 vol 2.8
                                • v2012 vol 1.4 - v2012 vol 1.10
                                • v2011 vol 2.5 - v2011 vol 2.14
                                • v2011 vol 1.4 - v2011 vol 1.12
                                • v2010 vol 2.9 - v2010 vol 2.11
                                • v2010 vol 2.3 - v2010 vol 2.8
                                • v2010 vol 1.4 - v2010 vol 1.12
                                • v2009 vol 3.2 - v2009 vol 3.7
                                • v2009 vol 2.4 - v2009 vol 2.13
                                • v2009 vol 1.5 - v2009 vol 1.11
                                • v2008 vol 3.2 - v2009 vol 1.4
                                • v8.2.2 - v8.2.10
                                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;
                                            }
                                        }
                                    }
                                }