Ticket Q202238
Visible to All Users

How to change ASPxObjectPropertyEditor's DetailView

created 16 years ago

I have the following problem:
the default DetailView is ReadOnly, and I need the ASPxObjectPropertyEditor to use another detailview, Child_DetailView_Editable instead.
How can I choose the DetailView to be used together by the ASPxObjectPropertyEditor ?
Thanks,
Costel.

Comments (1)
Anatol (DevExpress) 16 years ago

    Hello Costel,
    I apologize for the delay.
    These days we've been a little bit overloaded with support queries.
    We are working on your issue, and will answer you ASAP.
    Thanks,
    Anatol

    Answers

    created 16 years ago

    Hello Costel,
    As I see, you've already asked this question: ID Q201385 (Choose DetailView for DetailView PropertyEditor reference link). If you've encountered with some difficulties while implementing the custom ProeprtyEditor, please describe them, and we'll help you resolve them. Also, there is another solution to this task - you can create a ViewController with the following code:

    C#
    public class ViewController1 : ViewController { public ViewController1() { TargetViewId = "BO_Parent_DetailView"; } protected override void OnActivated() { base.OnActivated(); Application.DetailViewCreating += new EventHandler<DetailViewCreatingEventArgs>(Application_DetailViewCreating); } void Application_DetailViewCreating(object sender, DetailViewCreatingEventArgs e) { if (e.ViewID == "BO_Child_DetailView"){ e.ViewID = "BO_Child_DetailView_Editable"; } } protected override void OnDeactivating() { base.OnDeactivating(); Application.DetailViewCreating -= new EventHandler<DetailViewCreatingEventArgs>(Application_DetailViewCreating); } }

    See also: XafApplication.DetailViewCreating Event
    Thanks,
    Anatol

      Comments (1)
      A A
      Asist Asig Broker de Asigurare 16 years ago

        Hello Anatol,
        Your idea was brilliant. No more need for a custom propertyeditor as stated in http://www.devexpress.com/Support/Center/p/Q201385.aspx .
        I simply have this method
        void Application_DetailViewCreating(object sender, DetailViewCreatingEventArgs e)
                {
                    e.ViewID = DetailViewInterlinking.getDetailViewID(View.Id, e.ViewID);
                }
        and a dictionary of ViewIDs so I know how to redirect from what DetailView to what DetailView.
        I still think that this should be implemented in XAF, and maybe DetailViewInterlinking.getDetailViewID method would look for an attribute inside the model to see which detailview to redirect to.
        Many thanks,
        Costel.

        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.