Ticket T322072
Visible to All Users

How to show modal ASPxPopupControl

created 9 years ago (modified 9 years ago)

Hi there,

I'm trying  to create a modal loading panel that disables all background page functionality until a page redirection occurs. Like a "please wait while something happens" message.

I'm familiar with using the ASPxLoading Panel on components.

ASPx
<dxe:ASPxLoadingPanel ID="ASPxLoadingPanel" runat="server" ClientInstanceName="loadingPanel" Modal="True" Visible="True" ></dxe:ASPxLoadingPanel>

And then I use it as:

ASPx
loadingPanel.ShowInElementByID(someTextBox.name);

I'd like to do this sort of thing, but have it screen centered and as a modal that wouldn't allow the user to fiddle about with other stuff.
How can I accomplish this?

EDIT
After doing some thinking, I've rather decided to go for displaying a custom ASPxPopupControl instead:

ASPx
<dxpc:ASPxPopupControl runat="server" ClientInstanceName="searchPopup" HeaderText="Quick Search" Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" AllowDragging="false" Width="250px" Height="85px"> <ContentCollection> <dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server"> <table align="center"> <tr align="center"> <td align="center"> <dxe:ASPxLabel runat="server" Text="Searching..."/> </td> </tr> </table> </dxpc:PopupControlContentControl> </ContentCollection> <HeaderStyle VerticalAlign="Middle" /> <HeaderImage Url="~/Images/Icons/view.png" /> </dxpc:ASPxPopupControl>

So far this works well. It is displayed in the center of the screen, has a nice title, and I can place all sorts of components within it.

I do have a few problems with this component though:

  1. It has a close button by default.
  2. Clicking anywhere next to this ASPxPopupControl causes the dialog to be automatically closed, hence it's not modal at all even though its Modal property is set to true.

How can I
a) Hide this default close button or disable it?
and
b) Ignore any clicks the user makes outside of this ASPxPopupControl to prevent it from automatically closing?

Thanks,
JP

Comments (2)
Artem (DevExpress Support) 9 years ago

    Hello,

    Based on the provided information, it's not clear whether you need to display a panel near the ASPxTextBox or you need to make the ASPxLoadingPanel model only for a part of your content. Would you please clarify this?

    J J
    Jean-Pierre Damstra 9 years ago

      No problem, let me clarify my situation:
      I have a "Quick Search" textbox that does some magic and then directs the user to a page containing results. The dataset this search works with can at times be large and may take around 2-3 seconds for a result to be ready, hence I need a way to tell the user that all is okay and they just need to wait.
      After doing some thinking I've rather gone for displaying a custom ASPxPopupControl instead. Please see my edit above.

      Answers approved by DevExpress Support

      created 9 years ago (modified 9 years ago)

      Hello,

      I suggest that you set the ASPxPopupControlBase.ShowCloseButton property to False and ASPxPopupControl.CloseAction to None to resolve the issue. In this case, you will be able to close the popup using the ASPxClientPopupControlBase.Hide method when it is required (after processing is completed). Attached is a sample project illustrating this solution. Let me know if it helps.

        Comments (2)
        J J
        Jean-Pierre Damstra 9 years ago

          Thanks :)

          DevExpress Support Team 9 years ago

            You are always welcome.

            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.