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

RadWindow opened by checkbox click

3 Answers 101 Views
Window
This is a migrated thread and some comments may be shown as answers.
Tayonee
Top achievements
Rank 1
Tayonee asked on 16 Apr 2009, 05:32 PM
We are using a checkbox check to open a radwindow.  This works great.   However the checkbox does not remain checked.

Any ideas?

Thanks

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Apr 2009, 06:33 AM
Hi Tayonee,

I tried the scenario and its working fine for me. Give a try with this code is this is different from your code. Here is the code which I tried.

[ASPX]
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"
</telerik:RadWindowManager> 
<asp:CheckBox ID="CheckBox1" runat="server" /> 

[CS]
 
protected void Page_Load(object sender, EventArgs e) 
    CheckBox1.Attributes.Add("onclick", "showWindow(" + CheckBox1.ClientID + ");"); 

[JavaScript]
 
<script type="text/javascript"
var oWnd; 
function showWindow(checkbox) 
    if(checkbox.checked) 
    { 
        oWnd  = radopen ("http://www.google.com"null); 
    } 
    else if(oWnd) 
    { 
        oWnd.close(); 
    } 
</script> 

Checkout the following link for different methods for opening the RadWindow.
Opening Windows

Thanks,
Shinu.
0
Tayonee
Top achievements
Rank 1
answered on 20 Apr 2009, 10:45 PM
here is what we have:

.aspx
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Default" InitialBehavior="None" Left="" Style="display: none;" Top="">
      <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" Behavior="Default" Height="400px" Width="600px"
                               Title="Additional Services or Expertise Sought" InitialBehavior="None" Left="20" Top="20"
                                NavigateUrl="~/controls/HostPages/AdditionalServicesHost.aspx" Style="display: none;" Modal="True">
             </telerik:RadWindow>
       </Windows>
</telerik:RadWindowManager>

.vb
chkAdditionalServices.Attributes.Add("onclick", "showWindow(" + chkAdditionalServices.ClientID + ");return false;")

javascript
        var oWnd;
        function showWindow(checkbox) {
            if (checkbox.checked) {
                var oManager = GetRadWindowManager();
                //Show a particular existing window
                oManager.open(null, "RadWindow1");
            }
        }     




I tried using all the examples from the link you sent as well as the example you posted.  They work fine if not working with a radwindow inside a radmanager.  But when opening a radwindow inside a radmanager the checkbox does not stay checked.

It actually never gets checked.

Any other ideas?

Thanks
0
Accepted
Georgi Tunev
Telerik team
answered on 21 Apr 2009, 08:05 AM
Hi Tayonee,

The reason why the checkbox does not get selected is that you are canceling the event with the return false statement.
I am not quite sure what exactly is your scenario and what is the logic that you wish to implement, so for convenience I attached a small sample that shows 2 basic cases - to open RadWindow from the client or directly from the server.
I hope this helps.


Sincerely yours,
Georgi Tunev
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
Window
Asked by
Tayonee
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Tayonee
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or