Rad Combo Box refreshes the whole page

4 posts, 2 answers
  1. Meng
    Meng avatar
    57 posts
    Member since:
    Apr 2011

    Posted 22 Aug 2011 Link to this post

    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.

  2. Answer
    Rory
    Rory avatar
    159 posts
    Member since:
    Jul 2007

    Posted 22 Aug 2011 Link to this post

    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
  3. Answer
    Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 23 Aug 2011 Link to this post

    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 >>

  4. Meng
    Meng avatar
    57 posts
    Member since:
    Apr 2011

    Posted 23 Aug 2011 Link to this post

    Hi Guys,

    Thank you very much for the help. I will try it out.
Back to Top