如何在RadComboBox上显示加载图标选择的索引已更改

时间:2014-05-23 17:10:04

标签: c# combobox telerik

我已经从telerik实现了这个演示 http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

我只想要国家组合框显示加载图标,如上面的演示,这里是我的代码

<telerik:RadComboBox ID="RoomCategoryID" runat="server" Height="200px" Width="200px" EmptyMessage="Select Category"  
EnableLoadOnDemand="True" MarkFirstMatch="True" CausesValidation="False" AutoPostBack="True" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged"
                         ShowMoreResultsBox="True" EnableVirtualScrolling="True">
                         </telerik:RadComboBox>

和另一个组合框代码是

<telerik:RadComboBox ID="SubCategoryID" runat="server" Height="200px" Width="200px" EmptyMessage="Select Sub Category"
    EnableLoadOnDemand="True" MarkFirstMatch="True" CausesValidation="False" 
                             ShowMoreResultsBox="True" EnableVirtualScrolling="True"/>

,事件是

protected void DropDownList2_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
    //This event takes lots of time to load That's why I want Loading icon
    }

和ajax设置代码是

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
                <AjaxSettings>
     <telerik:AjaxSetting AjaxControlID="RoomCategoryID">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="SubCategoryID"/>
                    <telerik:AjaxUpdatedControl ControlID="pnlRoomExtra"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
                      </AjaxSettings>
                      </telerik:RadAjaxManager>
              <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

就我而言,它不是大陆和国家,而是RoomCategory和RoomSubCategory

1 个答案:

答案 0 :(得分:1)

在表单的开头添加RadScriptManager控件,如下所示:

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />

然后,在RadAjaxManager控件下添加RadAjaxLoadingPanelRadScriptManager控件,如下所示:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RoomCategoryID">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="SubCategoryID" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />