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

Custom confirmation handler from RadGrid and CommandItemTemplate - how?

1 Answer 79 Views
Window
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 21 Aug 2008, 06:07 PM
I have a <t:RadGrid>, with a <CommandItemTemplate>, which contains <asp:LinkButton>... for each command.  For a "Delete" operation, I use OnClientClick='ConfirmDelete(); return false' where ConfirmDelete says

window.radconfirm("Do you really...", confirmDeleteHandler, ...)

I would like to have a second similar confirmation action, except it needs to ask a custom question and have three choices.  Essentially, it works like above, but instead uses window.radopen("custom.aspx", "Custom").

In the later case, how do I get the callback function established for the radopen??

Because the opener is inside a template, I can't given an openerID in the <t:RadWindowManager><Windows><t:RadWindow openerElementID ...> and therefore I can't specify the OnClientClose="CustomConfirmHandler".

Thanks,
Tim

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 22 Aug 2008, 08:42 AM
Hello Tim,

You can set the OnClientClose function dynamically with the client-side API as well:

function openWin() 
    var oWnd = radopen("mypage.aspx","MyWindow"); 
    oWnd.add_close(OnClientClose);  
 
function OnClientClose(oWnd) 
    //your code 


Greetings,
Georgi Tunev
the Telerik team

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