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

open radwindow depending on validation

5 Answers 102 Views
Window
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 12 Aug 2008, 04:50 PM
I have a button inside the command item template of a grid.

I have the openerelementID of the radwindow set to that button's ID.
However when the user clicks the button I want to run a check to see if the user has selected any rows in the grid or not.
If there are rows selected I want to open the RadWindow where user can give some additional information and if there are no rows selected I want to prompt the user to select a row first and stop the RadWindow from showing.

I added a onclientclick event to the button where I can check whether rows are selected.But right now even if the rows are not selected it gives the prompt and then opens the RadWindow.

How can I stop that from happening?

5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 13 Aug 2008, 03:18 PM
Hi newbie,

In scenario like yours, OpenerElementID is not suitable. I suggest to open the RadWindow by using its client-side API instead (radopen() or show()). More information on RadWindow's client-side API is available in the documentation, section Controls / RadWindow / Programming.



Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
newbie
Top achievements
Rank 1
answered on 13 Aug 2008, 05:20 PM
Thanks.

I am able to open the window but how do I attach the Clientcallback function to the window opened with RadOpen?

0
newbie
Top achievements
Rank 1
answered on 13 Aug 2008, 05:39 PM

I used :

var
oWnd = $find("<%= DialogPopupAdd.ClientID %>");

oWnd.show();

and it works fine now.

Thanks.

0
Georgi Tunev
Telerik team
answered on 14 Aug 2008, 10:57 AM
Hello newbie,

You can dynamically set the ClientCallBackFunction by using
oWnd.set_clientCallBackFunction(MyClientCallBackFunction);

where MyClientCallBackFunction is the name of the function that you want to be executed.



Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
newbie
Top achievements
Rank 1
answered on 14 Aug 2008, 04:49 PM
Thanks. I appreciate the response.
It works fine now.
Tags
Window
Asked by
newbie
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
newbie
Top achievements
Rank 1
Share this question
or