Skip to main content
Tab

ASPxPopupControl.AutoUpdatePosition Property

Gets or sets the value that specifies whether the default popup window’s position is updated automatically, when required.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

Declaration

[DefaultValue(false)]
public bool AutoUpdatePosition { get; set; }

Property Value

Type Default Description
Boolean false

true if the popup window’s position is updated automatically; otherwise, false.

Remarks

The AutoUpdatePosition property is in effect if the default popup window is aligned at either a specific element explicitly defined via the ASPxPopupControl.PopupElementID property, or at the browser window’s center (the popup control’s ASPxPopupControl.PopupHorizontalAlign and ASPxPopupControl.PopupVerticalAlign properties are set to PopupHorizontalAlign.WindowCenter and PopupVerticalAlign.WindowCenter, respectively).

The AutoUpdatePosition property can be used to control whether the popup window’s position is updated automatically (after resizing the browser window, for instance).

For more details, see the E1080 Code Central example.

Example

This example demonstrates the following capabilities of the ASPxPopupControl when its popup window is used in modal mode:

- The ShowPageScrollbarWhenModal property allows the browser's vertical scrollbar to be displayed providing end-users with a capability to scroll the document content while the modal popup window is being shown;

- The AutoUpdatePosition property controls whether the popup window's position should be automatically recalculated after performing some popup window resizing or document scrolling operations.

View Example

<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dxe:ASPxCheckBox ID="cbShowPageScrollbarWhenModal" runat="server" Text="ShowPageScrollbarWhenModal" />
            <br />
            <dxe:ASPxCheckBox ID="cbAutoUpdatePosition" runat="server" Text="AutoUpdatePosition" />
            <br />
            <dxe:ASPxButton ID="btnShow" runat="server" Text="Show">
            </dxe:ASPxButton>
            <dxpc:ASPxPopupControl ID="popup" runat="server" ShowOnPageLoad="true" PopupElementID="ASPxButton1" Modal="True" 
                ShowPageScrollbarWhenModal="False" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" HeaderText="Gladiator" AllowDragging="True" AllowResize="True" EnableAnimation="False">
                <ContentCollection>
                    <dxpc:PopupControlContentControl runat="server">
                        <span class="Gray"><b>Directed by:</b> Ridley Scott<br />
                            <b>Year:</b> 2000</span><br />
                        <br />
                        <div style="font-family: Tahoma; font-size: 10px; color: #666666;">
                            When a Roman general is betrayed and his family murdered by a corrupt prince, he
                            comes to Rome as a gladiator to seek revenge.</div>
                    </dxpc:PopupControlContentControl>
                </ContentCollection>
               <ClientSideEvents Init="function(s, e) { s.Show(); }" />
            </dxpc:ASPxPopupControl>
            <div style="height: 2000px" />
        </div>
    </form>
</body>
</html>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        if(IsPostBack) {
            popup.ShowPageScrollbarWhenModal = cbShowPageScrollbarWhenModal.Checked;
            popup.AutoUpdatePosition = cbAutoUpdatePosition.Checked;
        }
    }
}
See Also