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

Opening position of RadWindow

3 Answers 218 Views
Window
This is a migrated thread and some comments may be shown as answers.
Imran
Top achievements
Rank 1
Imran asked on 18 Jan 2009, 03:17 PM
I have a user control of "EmailToFriend" which opens a RadWindow to enter email.I used that control in a ListView therefore there are 10-15 instances of that control on Page. I want to open the radwindow at a position relative to that instance of EmailToFriend on which user cliked.Also I want only one instance of radwindow to open again & again instead of each time creating new instance to enhance performance.How can I pass the position of specific control as an argument to RadWindow. I used the ClientID but it only works when I created a new instance each time.................Thanks

3 Answers, 1 is accepted

Sort by
0
Imran
Top achievements
Rank 1
answered on 19 Jan 2009, 08:10 AM
here is the javascript function that I used to open RadWindow

function openEmailToFriend(ClientID) {

        var oWnd = radopen("EmailToFriend.aspx", "EmailToFriendWin");
        oWnd.SetWidth(220);
        oWnd.SetHeight(200);
        oWnd.SetOpenerElementId(ClientID);
        oWnd.set_offsetElementID(ClientID);
        return false;  

    }
I passed the clientID to this function and it opens the Window at correct position only first time....after that if I click on any other instance of EmailToFriend (on some other position ) it always opens the window at the position where it first opened the window

Kindly help me in this regard

Thanks
0
Accepted
Fiko
Telerik team
answered on 19 Jan 2009, 01:18 PM
Hello Imran,

In cases where there is more complex scenarios- WebUserControls, MasterPages involved, etc, I strongly recommend to use either the Client-Side or the Server-Side API for positioning the RadWindow. For example in the current case I would suggest to use the client-Side API  - oWindow.moveTo() function.

For your convenience I prepared a sample demo project for you and attached it to the thread.


All the best,
Fiko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Imran
Top achievements
Rank 1
answered on 20 Jan 2009, 06:00 AM
Hello Fiko,
Thank you so much for your help as this solved my problem.

Regards
Imran
Tags
Window
Asked by
Imran
Top achievements
Rank 1
Answers by
Imran
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or