Example E622
Visible to All Users

XAF - Prevent Showing a Detail View of a List View Object

This example demonstrates how to prevent a user from invoking a Detail View of an object in a List View.

To allow users to edit objects directly in a List View, enable the in-place edit and split layout functionality.

Implementation Details

Call the Frame.GetController method to access an instance of the ListViewProcessCurrentObjectController class and disable the ListViewProcessCurrentObjectController.ProcessCurrentObjectAction property.

Additional Information

This example applies only when an XAF application displays a Detail View of an object after a user double-clicks this object in a List View, or focuses an object in a List View and presses Enter. To handle other scenarios, extend the controller's code. For example, if you do not want your XAF application to invoke a Detail View after a user clicks the New button to create an object in a List View, handle the NewObjectViewController.ObjectCreating event and set the ObjectCreatingEventArgs.ShowDetailView property to false.

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

Example Code

EFCore/MySolution/MySolution.Module/Controllers/DisableShowingViewController.cs
C#
using DevExpress.ExpressApp; using DevExpress.ExpressApp.SystemModule; namespace dxTestSolution.Module.Controllers { public class DisableShowingViewController : ViewController { protected override void OnActivated() { base.OnActivated(); ListViewProcessCurrentObjectController targetController = Frame.GetController<ListViewProcessCurrentObjectController>(); if (targetController != null) { targetController.ProcessCurrentObjectAction.Enabled["MyReason"] = false; } } } }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.