我已经从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
答案 0 :(得分:1)
在表单的开头添加RadScriptManager
控件,如下所示:
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
然后,在RadAjaxManager
控件下添加RadAjaxLoadingPanel
和RadScriptManager
控件,如下所示:
<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" />