Fitting Control to 100% width and 100% height

3 posts, 0 answers
  1. Simon
    Simon avatar
    32 posts
    Member since:
    Apr 2007

    Posted 20 Jul 2011 Link to this post

    Hello

    I would like to fit the ImageEditor control to 100% of the available space on the page. However when I set the height to 100% and the width to 100% it makes the control look all funny. What setting do I do to fit the control in 100%.

    Regards,
    Simon
  2. Simon
    Simon avatar
    32 posts
    Member since:
    Apr 2007

    Posted 20 Jul 2011 Link to this post

    I have managed to get this code to resize the control nicely.


    window.onload = onWindowLoad;
            window.onresize = onWindowResize;
     
            function onWindowLoad() {
     
                setTimeout("document.getElementById('imgEditor').style.width = (getWindowWidth() - 10) + 'px';", 500);
                setTimeout("document.getElementById('imgEditor').style.height = (getWindowHeight() - 10) + 'px';", 500);
                setTimeout("document.getElementById('imgEditor_Viewport').style.height = (getWindowHeight() - 80) + 'px';", 500);
                 
            };
     
            function onWindowResize() {
     
                document.getElementById("imgEditor").style.width = (getWindowWidth() - 10) + 'px';
                document.getElementById("imgEditor").style.height = (getWindowHeight() - 10) + 'px';
                document.getElementById("imgEditor_Viewport").style.height = (getWindowHeight() - 80) + 'px';
     
            }
     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 22 Jul 2011 Link to this post

    Hi Simon,

    Thank you for sharing your code with the community.

    I just want to add that we will provide support for Width and Height values in percents for the next Q2 2011 SP1 build of RadImageEditor.

    Greetings,
    Rumen
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top