Ticket Q247300
Visible to All Users

How to get ASPxPopupControl to open Modal when used inside a User Control

created 15 years ago

I've added the ASPxPopupControl to a User Control so that I can ensure a consistent look and feel through my web application when using the popup control. I've got the popup control appearing properly thus far, but have found the MODAL setting is being ignored. Is there a solution to get around this?

Show previous comments (6)
DevExpress Support Team 15 years ago

    Gregory,
    The ASPxPopupControl closes by default when you click outside of the popup's area: ASPxPopupControl.CloseAction. If you wish to change this behavior, and the popup should be closed via the "Close" button only, you should set this property equal to CloseButton.
    I've also attached a small screencast which demonstrates this solution.
    Thanks,
    Vest

      Thanks Vest, that helped me.
      I have just a couple of more things I'd like to ask.

      1. ) My understanding of MODAL through my years of programming has always been that if a Window is Set ot MODAL, then it would not loose focus if the end-user clicked outside the window area. But, in this case that's not what MODAL represents it seems. The CloseAction is doing what I expect it to. But, could you explain to me then what the MODAL property is for then?
      2. ) Now that I know the CloseAction setting needs to be set to CloseButton I can achieve the behaviour I want. My preference is that I be able to control this setting via a property as I've been setting my other properties. Such as:
        - This propert lets me set the ShowOnPageLoad value from the calling parent page based on setting a boolean value.
        --> public bool ShowOnPageLoad {
                get { return this.pcYesNo.ShowOnPageLoad; }
                set { this.pcYesNo.ShowOnPageLoad = value; }
            }
        - This property setting for CloseAction will not work. I notice there is a CloseAction Enumerator that contains the valid values. My thinking is I would make the property an INT. But, this doesn't work. Can you advise what on how I should be setting up this property. By default, I'll have it set to CloseButton, but I would like to have control over its settting if possible from the calling parent page. (I hope my question is clear here).
        --> public int CloseAction {
              get { return this.pcYesNo.CloseAction; }
              set { this.pcYesNo.CloseAction = value; }
            }
        Thank you very much for your help as I know I can now proceed with using the ASPxPopupControl as I wish.
        Look forward to your reply.
        Greg
      DevExpress Support Team 15 years ago

        Hello Gregory,
        Yes, I completely agree with your understanding of the "Modal" behavior. The modal window knows its parent, and when it is shown, the parent window doesn't receive any events. On the web, the true modality appears when the alert message or the confirmation dialog is shown. All these popups are made by the browser, and in this case, the browser doesn't allow you to click its content.
        In HTML documents, the modality is emulated via many tricks: all editors are hidden (disabled), some transparent objects are shown over them, and block all events, and so on. Our ASPxPopupControl simply draws a gray div between an HTML document and a popup window. It catches all events, and when you hide a button (for example) with it, you won't be able to click on it. Of course, the ASPxPopupControl can be closed in many ways, one of them is to use the ASPxPopupControl.CloseAction property. We know that this modality might be confusing to users, but in our opinion, this is the most convenient implementation.
        Thanks,
        Vest

        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.