Maximised modal RadWindow changing position on screen

3 posts, 0 answers
  1. Nick
    Nick avatar
    2 posts
    Member since:
    Jul 2014

    Posted 11 Jul 2014 Link to this post

    Hi there,

    We use a CrystalReportsViewer inside a modal RadWindow to show reports inside our application.  I've received a number of reports from our users that when they move to the next page in a report, the "close button" disappears.  Whilst investigating this issue, I battled to reproduce it until I discovered that it seems to only happen on smaller displays / lower resolutions, perhaps when the content of the RadWindow is larger than the browser window.

    Essentially what is happening is that when the next page button is clicked, the RadWindow is "jumping up" a few millimeters and concealing the title bar behind the browser's address bar.  If the user resizes the browser window, even by a FRACTION, or if they zoom in and out (basically anything that causes a redraw), the RadWindow fixes itself immediately.

    I have created an animated gif of the phenomenon to try and illustrate the issue.  I have exaggerated the size of the browser window here to replicate the problem clearly. Please take a look and let me know if you have any ideas as to what could be causing this.

    Nick

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 11 Jul 2014 Link to this post

    Hi Nick,

    Such behavior can be observed can be observed in the following cases (that I know of):

    • the clicked button is an anchor (i.e., its HTML element is something like <a href="#"></a>), This causes the browser to attempt to scroll so that this anchor is the topmost element, but it is likely that there simply isn't enough content so the change of position is slight
    • the page/content that loads after the button is clicked has default focus. The browser attempts to call scrollIntoView() on that element, but it fails to take into account the absolute positioning of the iframe and thinks that the focused element is in the beginning of the page so it tries to scroll (much like an anchor).

    The fixes for these situations are as follows:

    • modify the anchor's href attribute to avoid the browser default behavior: <a href="javascript:void(0);"></a>.
    • remove the default (server) focus and use the Sys.Application.Load event (or any other applicable event when the content is fully rendered) to focus the desired element with a small timeout.
    • if you can - simply raise the window.resize event in the appropriate event. Note that this has to happen on the main page, not in the RadWindow context: http://stackoverflow.com/a/15971955/812369.

    I hope this helps so you can incorporate the appropriate idea in your actual case.


    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nick
    Nick avatar
    2 posts
    Member since:
    Jul 2014

    Posted 11 Jul 2014 Link to this post

    Hi Marin,

    Thank you for the swift response!  I was able to solve the issue by raising the window.resize event as you suggested.

    Nick
Back to Top