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

CommandItemTemplate ImageButton RadWindow Dialog

2 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
KingPrawn
Top achievements
Rank 1
KingPrawn asked on 29 May 2009, 04:27 PM
Hi,

Is it possble to have a RadWindow displayed as a dialog from an ImageButton within the CommandItemTemplate?

I've been able to get it to display a 'radconfim' dialog box using the OnClientClick.  However how do I continue/run the ItemCommand event if the user clicks ok?

Regards
kp

2 Answers, 1 is accepted

Sort by
0
Bruno
Top achievements
Rank 2
answered on 01 Jun 2009, 10:06 AM
You may try something similar to the following:

 <telerik:RadGrid runat="server" ID="RadGrid1"
            <MasterTableView DataKeyNames="Value" CommandItemDisplay="Top"
                <CommandItemTemplate> 
                    <asp:ImageButton runat="server" ID="MyImageCommandButton" CommandName="MyCommand" 
                        OnClientClick="if(!myConfirm(this, event)) return false;" /> 
                </CommandItemTemplate> 
            </MasterTableView> 
        </telerik:RadGrid> 
 
        <script type="text/javascript"
            function myConfirm(el,e) { 
                if(!el.result) 
                { 
                    radconfirm("Are you sure?", 
                        function(result) { 
                            if(result) { 
                                el.result=result; 
                                if(window.netscape) { 
                                    __doPostBack(el.name,""); 
                                    return el.result=null
                                } 
                                el.click(e); 
                            } 
                        }); 
                         
                    el.result=null
                    return false; 
                } 
                el.result=null
                return true;                 
            } 
        </script> 

--Bruno
0
Rosen
Telerik team
answered on 01 Jun 2009, 10:07 AM
Hi Bruno,


Regards,
Author nickname
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
KingPrawn
Top achievements
Rank 1
Answers by
Bruno
Top achievements
Rank 2
Rosen
Telerik team
Share this question
or