Ticket S30657
Visible to All Users

How do I open a separate DetailView from a nested ListView with MasterDetailMode set to ListViewAndDetailView?

Answers approved by DevExpress Support

created 16 years ago (modified 6 years ago)

Hi Jascha,

To open the selected object's DetailView in a separate window in this scenario, override the XafApplication.ShowDetailViewFrom method in the WinApplication.cs file and return True for the required View. For example:

C#
namespace MainDemo.Win { public partial class MainDemoWinApplication : WinApplication { public override bool ShowDetailViewFrom(Frame sourceFrame) { if (sourceFrame != null && sourceFrame.View is ListView) { if (sourceFrame.View.Id == "Master_Details_ListView") { return true; } } return base.ShowDetailViewFrom(sourceFrame); }

If you prefer to do this in a controller, use the following code:

C#
using System; using DevExpress.ExpressApp; public class EnableOpenDetailViewFromNestedListViewInDualModeViewController : DevExpress.ExpressApp.SystemModule.ListViewProcessCurrentObjectController { protected override void ProcessCurrentObject(SimpleActionExecuteEventArgs e) { if (View.Id == "Contact_Tasks_ListView") { ShowObject(((ListView)View).CurrentObject, e.ShowViewParameters, Application, Frame, View); } else { base.ProcessCurrentObject(e); } } }

Does this solution meet your needs?

See Also:
How to skip opening a new window for a created object when MasterDetaiMode = ListViewAndDetailView for a root ListView

#open detail view from nested, open detailview from nested, show detail view from nested, show detailview from nested ListViewAndDetailView detailview edit

    Comments (1)

      Hi Dennis,
      Just to let you know that I based a working solution on your workaround. FYI I did have to create and open the detail view via explicit code (and not via action.DoExecute) to prevent the view opening in the same object space but other than that it works well. Also, View.ProcessSelectedItem doesn't compile ;-)
      Many thanks,
      Jascha

      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.