This is a migrated thread and some comments may be shown as answers.

Is there a Window OnMaximize event?

8 Answers 142 Views
Window
This is a migrated thread and some comments may be shown as answers.
Telmo Silva
Top achievements
Rank 1
Telmo Silva asked on 27 Aug 2008, 10:37 AM
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


8 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 27 Aug 2008, 11:58 AM
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.
0
Telmo Silva
Top achievements
Rank 1
answered on 27 Aug 2008, 09:28 PM
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.

 
0
Georgi Tunev
Telerik team
answered on 28 Aug 2008, 06:53 AM
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.
0
Telmo Silva
Top achievements
Rank 1
answered on 29 Aug 2008, 05:48 PM
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
0
Georgi Tunev
Telerik team
answered on 01 Sep 2008, 10:46 AM
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.
0
SimplyPM
Top achievements
Rank 1
answered on 18 Dec 2008, 09:14 PM
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
0
Georgi Tunev
Telerik team
answered on 19 Dec 2008, 11:26 AM

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.
0
Brian Kowald
Top achievements
Rank 1
answered on 14 Aug 2009, 04:28 PM
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
Tags
Window
Asked by
Telmo Silva
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Telmo Silva
Top achievements
Rank 1
SimplyPM
Top achievements
Rank 1
Brian Kowald
Top achievements
Rank 1
Share this question
or