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

[Solved] RadCBB + RadAjaxManager dosen't work

2 Answers 99 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Alex Zhang
Top achievements
Rank 1
Alex Zhang asked on 22 Dec 2009, 12:30 AM
Hi guys,

I just got a issue with RadComboBox + RadAjaxManager.
The Scenaria:

Two cbb1 and cbb2 on the web page.
I use RadAjaxManager to update cbb2 when cbb1 posted back.
And when cbb1 selectedindex changed, pop up an new window.

but whatever I setup for RadAjaxManager the new window never popup.


<Format Code Block>
form id="form1" runat='server'>        
             <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
             </telerik:RadScriptManager>
             <telerik:RadAjaxManager id="amgr1" runat="server" >
                  <AjaxSettings>
                        
                      <telerik:AjaxSetting AjaxControlID="rcbbTest1">
                        <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="rcbbTest2" />
                           <telerik:AjaxUpdatedControl ControlID="rcbbTest1" />
                        </UpdatedControls>
                     </telerik:AjaxSetting>
                     <telerik:AjaxSetting AjaxControlID="rcbbTest2">
                        <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="rcbbTest2" />
                         
                        </UpdatedControls>
                     </telerik:AjaxSetting>
                     <telerik:AjaxSetting AjaxControlID="rcbbTest3">
                        <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="rcbbTest3" />
                        </UpdatedControls>
                     </telerik:AjaxSetting>
                  </AjaxSettings>
             </telerik:RadAjaxManager>
            <table>
               <tr>
                  <td>
                     <telerik:RadComboBox ID="rcbbTest1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rcbbTest1_OnSelectedIndexChanged">
                        <Items>
                           <telerik:RadComboBoxItem Text="1"  />
                            <telerik:RadComboBoxItem Text="11"  />
                        </Items>
                     </telerik:RadComboBox>
                  </td>
               </tr>
                <tr>
                  <td>
                     <telerik:RadComboBox ID="rcbbTest2" runat="server" AutoPostBack="true"  OnSelectedIndexChanged="rcbbTest2_OnSelectedIndexChanged">
                        <Items>
                           <telerik:RadComboBoxItem Text="2"  />
                            <telerik:RadComboBoxItem Text="22"  />
                        </Items>
                     </telerik:RadComboBox>
                  </td>
               </tr>
                <tr>
                  <td>
                     <telerik:RadComboBox ID="rcbbTest3" runat="server" AutoPostBack="true"  OnSelectedIndexChanged="rcbbTest3_OnSelectedIndexChanged">
                        <Items>
                           <telerik:RadComboBoxItem Text="3"  />
                            <telerik:RadComboBoxItem Text="33"  />
                        </Items>
                     </telerik:RadComboBox>
                  </td>
               </tr>
            </table>              
      </form>
-- C#
protected void rcbbTest1_OnSelectedIndexChanged(object sender, EventArgs e)
      {
         string url = "Request.aspx?subject='Request Client Access1'";

         Telerik.Web.UI.RadWindow newWindowClient = new Telerik.Web.UI.RadWindow();
         newWindowClient.NavigateUrl = url;
         newWindowClient.VisibleOnPageLoad = true; // Set the VisibleOnPageLoad to true
         newWindowClient.Title = "1";
         this.Page.Form.Controls.Add(newWindowClient);
      }
</Format Code Block>

Thanks for your help


Alex

2 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 22 Dec 2009, 01:55 PM
Hello Alex Zhang,

Please try the following:

1. Add a placeholder on your page:
<asp:PlaceHolder ID="place1" runat="server"></asp:PlaceHolder>

2. Set the AjaxSettings so the combo1 updates the place1 placeholder:

<AjaxSettings>                       
  <telerik:AjaxSetting AjaxControlID="rcbbTest1">
    <UpdatedControls>
       <telerik:AjaxUpdatedControl ControlID="rcbbTest2" />
       <telerik:AjaxUpdatedControl ControlID="place1" />
    </UpdatedControls>
 </telerik:AjaxSetting>

3. Add the RadWindow object to that placeholder:

protected void rcbbTest1_OnSelectedIndexChanged(object sender, EventArgs e)
{
    string url = "Request.aspx?subject='Request Client Access1'";
 
    Telerik.Web.UI.RadWindow newWindowClient = new Telerik.Web.UI.RadWindow();
    newWindowClient.NavigateUrl = url;
    newWindowClient.VisibleOnPageLoad = true; // Set the VisibleOnPageLoad to true
    newWindowClient.Title = "1";
    place1.Controls.Add(newWindowClient);
}

Now, when you change the selection of the first combo - after the ajax request you will see the RadWindow.

All the best,
Veskoni
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Alex Zhang
Top achievements
Rank 1
answered on 22 Dec 2009, 10:48 PM
Hi Veskoni,

It works! Thanks for your help.
The issue been hover at top of my head for a few weeks.
Right now I see the blue sky again :-)

All the best for the Christmas and New Year!

Cheers,

Alex
Tags
ComboBox
Asked by
Alex Zhang
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Alex Zhang
Top achievements
Rank 1
Share this question
or