Ticket S170961
Visible to All Users

Core - How to display an unsaved / new object in an existing DetailView

created 12 years ago (modified 9 years ago)

Typical scenarios include setting a new object to the embedded DetailView of a DashboardViewItem or ListView in ListViewAndDetailView mode.

UPDATED
Currently, you can accomplish this task by handling the XafApplication.DetailViewCreating event and recreating the whole DetailView by calling the CreateDetailView method and passing the new object as a parameter:

C#
void Application_DetailViewCreating(object sender, DetailViewCreatingEventArgs args) { if(args.ViewID == "YourDetailViewInDashboard") { IObjectSpace os = Application.CreateObjectSpace(); //Dennis: A separate ObjectSpace is created for each root embedded View within the DashboardView. YourObjectType theObject = os.CreateObject<YourObjectType>(); theObject.Name = "test"; args.View = Application.CreateDetailView(os, theObject); args.View.ViewEditMode = ViewEditMode.Edit; Application.DetailViewCreating -= Application_DetailViewCreating; } }
Comments (2)

    I can't see the original question, it's been marked as private, so I don't know if a temporary work-around was provided. If there was a work-around, can you please make it public?

      As far as I know, there is no workaround and the state of the issue is still unchanged.

      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.