Is there a Window OnMaximize event?

9 posts, 0 answers
  1. Telmo Silva
    Telmo Silva avatar
    16 posts
    Member since:
    Jul 2008

    Posted 27 Aug 2008 Link to this post

    I would like some help in achieving the following functionality:

    When user clicks the Maximize command, call a function once the window has been resized.

    Currently, using the OnClient Command, the event is fired before the window is actually maximized therefore I am unable to generate new content based on the new size.

    Additionally, the OnClientResize event is not triggered when a Maximize is executed.

    Any help is greatly appreciated and needed!

    Telmo


  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 27 Aug 2008 Link to this post

    Hi Telmo Silva,

    Indeed, OnClientResize will not be fired if the window is maximized - maximizing the window is not resizing. As for OnClientCommand, you can achieve the desired result by using a simple timeout - this will allow you to gather the needed data.



    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Telmo Silva
    Telmo Silva avatar
    16 posts
    Member since:
    Jul 2008

    Posted 27 Aug 2008 Link to this post

    Hi Georgi,

    Thanks for the quick response.  I did add a setTimeout of a few milliseconds and indeed the width and height of the resized window is available. 

    I particularly do not like this method (a) not sure of the timeout value (do I need a longer timeout or shorter timeout depending on the speed of rendering?) and (b) in the contents take a while to resize looking like my application and your controls are slow.

    The OnClientResize works wonders since when the user is finished resizing it is triggered allowing me to proceed to redraw the contents.  Perhaps something similar should be done for the maximize event.

     
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 28 Aug 2008 Link to this post

    Hello Telmo,

    I suggest to try with a timeout of 0ms - this is the best that can be done in this scenario. As I noted previously OnClientResize contradicts to the idea of maximizing an object and the OnClientCommandEvent is fired before the actual event in order to provide the option for canceling.


    Greetings,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Telmo Silva
    Telmo Silva avatar
    16 posts
    Member since:
    Jul 2008

    Posted 29 Aug 2008 Link to this post

    Hi Georgi,

    Thanks for the solution by the way.  The setTimeout does work well.  Also please do not miunderstand, I am not requesting to have the OnResize triggered when a Maximize occurs, I am suggesting that perhaps there should an OnMaximized event of some kind, or perhaps the COmmand is good enough.  Like I said, I am not clear on the parameters for the timeout (will it depend on something ? speed of rendering perhaps?).

    Somehow, my gut tells me it is a bit of a temporary gap plug but perhaps I do not understand the sequence of events well enough to say.  Either way, it has been working quite well.

    Thank you,
    Telmo
  7. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 01 Sep 2008 Link to this post

    Hello Telmo,

    It is good to know that everything is working fine now. As for your suggestion, I logged it in our database and if other users request similar functionality as well, we will consider adding such property for the control.


    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. SimplyPM
    SimplyPM avatar
    12 posts
    Member since:
    Sep 2012

    Posted 18 Dec 2008 Link to this post

    Georgi,

    I've encountered the same issue, and although the workaround gets me past it, I'd also like to throw in a request for the OnClientResize event to be fired after the window is maximized.

    To say that "maximizing the window is not resizing" makes no sense. When the window is maximized, its size changes. That's sort of the definition of "resize".

    Thanks much,
    Ken
  9. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 19 Dec 2008 Link to this post


    OK Ken, your vote has been logged.




    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Brian Kowald
    Brian Kowald avatar
    2 posts
    Member since:
    Aug 2009

    Posted 14 Aug 2009 Link to this post

    I too, would like to chime in onasking for an OnMaximized event. In the meantime, I will probably remove the maximize behavior as opposed to using the timeout.
    Thanks,
    Brian
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017