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

set_Behaviors (client side)

7 Answers 453 Views
Window
This is a migrated thread and some comments may be shown as answers.
Skypy
Top achievements
Rank 1
Skypy asked on 31 Mar 2008, 01:46 PM
Hello,

I think there is a mistake in Prometheus 'Future' documentation for RadWindow methods :
e.g: oWnd.set_Behaviors( Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close )

<%= ... %> are missing around WindowBehaviors

7 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 31 Mar 2008, 02:33 PM
Hello Skypy,

Do you experience problems using the code in the documentation? There is no need to wrap the behaviors like that - they are set exactly like shown in the help article.



Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Skypy
Top achievements
Rank 1
answered on 31 Mar 2008, 02:37 PM
With code from documentation it gives an 'undefined' error, maybe my post should help someone else, one day.
0
Accepted
Georgi Tunev
Telerik team
answered on 31 Mar 2008, 03:05 PM
Hello Skypy,

I am not sure what can be the reason for the problem on your side, but if you open a new support ticket and send us a small sample project where it can be reproduced, we will check it right away.

For convenience I attached a small code sample that shows how to set up the behavior along with a movie that shows the result of the code.



Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Skypy
Top achievements
Rank 1
answered on 31 Mar 2008, 03:12 PM
In my case there is no CodeFile attached to aspx, I think this is the source of 'problem'.

Thanks for your sample.
0
Georgi Tunev
Telerik team
answered on 31 Mar 2008, 03:28 PM
Hi Skypy,

Not having a code-behind file should not be the reason for the problem. If you still experience problems, please send us a sample project that we can check and we will do our best to help.



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Charlie Bross
Top achievements
Rank 1
answered on 30 Aug 2008, 12:49 AM
I ran into this exact same issue this evening. It was saying that the Telerik.Web.UI.WindowBehaviors.Move was not defined. I downloaded the attached movie file and one thing that I noticed is that it has a RadWindow control on the page. In my case I am actually opening the new window from the parent window's RadWindowManager so I had no need to have a RadWindow or RadWindowManager on my page. Once I added an empty RadWindow to the page (also works with a RadWindowManager), the Telerik.Web.UI.WindowBehaviors.Move was recognized and the behaviors worked as designed. Apparently, the Telerik behaviors are not being pushed down to the client unless a RadWindow or Manager has been added to the page. (I dont think this is a bug at all, just one of those gotchas). I'm not sure if this is the same thing that was happening for Skypy, but this might help someone else.
0
Georgi Tunev
Telerik team
answered on 01 Sep 2008, 03:25 PM
Hello Charlie,

Yes, the scenario that you describe will lead to such problem. The good news however, is that there is an easy solution for it.

Telerik.Web.UI.WindowBehaviors is an enum. The magic numbers that will help are as follows :)

None : 0,       
Resize : 1, 
Minimize : 2,
Close : 4,  
Pin : 8,
Maximize : 16,
Move: 32,
Reload: 64,
Default: (1 + 2 + 4 + 8 + 16 + 32 + 64)

As you can see, you can set an integer as RadWindow's behavior but now you can use the set_behaviors() method from the content page without having a RadWindowManager declared in it. For convenience I attached a small sample that shows this approach in action.

Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Skypy
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Skypy
Top achievements
Rank 1
Charlie Bross
Top achievements
Rank 1
Share this question
or