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

Rad Combo Box refreshes the whole page

3 Answers 189 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Meng
Top achievements
Rank 1
Meng asked on 22 Aug 2011, 06:27 PM
Hi there,

I have two Rad combo boxes, the value of the second one pops up when the first one is selected. The problem is the whole page refreshes if I use the OnSelectedIndexChanged property

OnSelectedIndexChanged

= "ddlName_SelectedIndexChanged"

 

protected void ddlName_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
       {
        //refresh the value of the second combo box here
       }

Anyone knows how to only let the value of the second Combo box refresh, not the whole page? Any help is very much appreciated.

3 Answers, 1 is accepted

Sort by
0
Accepted
Rory
Top achievements
Rank 1
answered on 22 Aug 2011, 09:55 PM
Hi Meng,
Have you tried using the RadAjaxManager? You would add some code like so.

<telerik:RadAjaxManager ID="ajaxMgr" runat="server">
          <AjaxSettings>
             <telerik:AjaxSetting AjaxControlID="comboBox1">
                  <UpdatedControls>
                      <telerik:AjaxUpdatedControl ControlID="comboBox2" />
                  </UpdatedControls
             </telerik:AjaxSetting>
         </AjaxSettings>
</telerik:RadAjaxManager>

Try looking at more examples here:
http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/firstlook/defaultcs.aspx
0
Accepted
Ivana
Telerik team
answered on 23 Aug 2011, 07:41 AM
Hello Meng,

Here is an example of how to update the second ComboBox control using RadAjaxManager.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox2" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelHeight="100px" UpdatePanelRenderMode="Block" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="186px" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
            AutoPostBack="true">
            <Items>
                <telerik:RadComboBoxItem Text="Item 1" Value="value1" />
                <telerik:RadComboBoxItem Text="Item 2" Value="value2" />
                <telerik:RadComboBoxItem Text="Item 3" Value="value3" />
            </Items>
        </telerik:RadComboBox>
        <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="186px">
        </telerik:RadComboBox>
    </div>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" MinDisplayTime="1000">
    </telerik:RadAjaxLoadingPanel>

More information about  RadAjaxManager and  RadAjaxLoadingPanel  can be found here.

Greetings,
Ivana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Meng
Top achievements
Rank 1
answered on 23 Aug 2011, 01:29 PM
Hi Guys,

Thank you very much for the help. I will try it out.
Tags
ComboBox
Asked by
Meng
Top achievements
Rank 1
Answers by
Rory
Top achievements
Rank 1
Ivana
Telerik team
Meng
Top achievements
Rank 1
Share this question
or