Ticket Q232077
Visible to All Users
Duplicate

How to set height and width of aspxpopupcontrol dynamically?

created 16 years ago

Hello,
       I am having a requirement where I have to increase the popupcontrol based on the content. Baasically I am loading a user control dynamically to aspxpopupcontrol. The user control has callbackpanel where the content is rendered based on the radio button which is also part of user control. The need is here to dynamically increase the widith and height of aspxpopupcontrol. I am able to resize and it works in all desktop to specified size based on selected radio button. Below I ahve given the piece of js code that does this.
function SetPopupSize(sender, height, width) {
    var popupWidth, popupHeight;
// popupWidth = window.parent.document.documentElement.clientWidth * (width / 100);
// popupHeight = window.parent.document.documentElement.clientHeight * (height / 100);
popupWidth = screen.width * (width / 100);
    popupHeight = screen.height * (height / 100);
    sender.SetSize(popupWidth, popupHeight);
    sender.UpdatePosition();
I have commented two lines which is also working. But it works different in laptop and small screens. so tired the screen.height and width to set the size. It renderes fine in all desktop screen. But I am getting vertical scroll bar mostly and sometimes getting horizontal scroll bar in laptop screens. What I have to do to make it consistent based on screen resolution. Please let me know regardign this.
Regards,
Elango
}

Comments (2)
DevExpress Support Team 16 years ago

    Hi Elango,
    You can determine the client's screen resolution using the approach provided in the following article: Screen Resolution Detection. Then set the size of your ASPxPopupControl based on the obtained values.
    With best regards,
    Ivan N.

    EB EB
    Elango Balakrishnan 15 years ago

      Fixed it by dynamically finding the screen size and resizing the popup window.

      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.