RadAjaxManager与RadCombobox,性能非常慢

时间:2013-11-18 14:43:43

标签: asp.net ajax telerik

我正在使用带有RadAjaxManager和RadComboBox的页面。

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
    DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnablePageHeadUpdate="False">
     <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="_Partners" >
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="_SubPartners" />
                 <telerik:AjaxUpdatedControl ControlID="_Clients" />
                 <telerik:AjaxUpdatedControl ControlID="_Positions" />
                 <telerik:AjaxUpdatedControl ControlID="_Candidates" />
             </UpdatedControls>
         </telerik:AjaxSetting>

         <telerik:AjaxSetting AjaxControlID="_Candidates">
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="rpCandidateApplications" />
             </UpdatedControls>
         </telerik:AjaxSetting>

         <telerik:AjaxSetting AjaxControlID="_SubPartners">
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="_Clients" />
                 <telerik:AjaxUpdatedControl ControlID="_Candidates" />
                 <telerik:AjaxUpdatedControl ControlID="_Positions" />
             </UpdatedControls>
         </telerik:AjaxSetting>

我有大数据绑定,但它加载的数据非常慢,我的客户端正在关注性能。任何帮助都将不胜感激!

1 个答案:

答案 0 :(得分:0)

如何将项目绑定到对象有多种选择,但我倾向于用于大型数据集的方法是“按需加载”。当设置为RadComboBox时,Telerik EnableLoadOnDemand有一个名为true的属性,这将获得下一组数据。查看网络分析器,您将看到向服务器发出的小请求,以获取填充下拉列表所需的数据。

示例:

<asp:SqlDataSource ID="sqlOptions" runat="server" ConnectionString='<%$ ConnectionStrings:WebsiteData %>'
    SelectCommand="uspGetOptions" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
<telerik:RadComboBox ID="ddlOptions" runat="server"  Width="100%" AppendDataBoundItems="false"
    MaxHeight="100px" DataTextField="DisplayText" DataValueField="UniqueId" DataSourceID="sqlOptions"
    EnableAutomaticLoadOnDemand="true" EnableLoadOnDemand="true" AllowCustomText="false" Filter="None"
    ShowWhileLoading="true"  ItemsPerRequest="20" EnableVirtualScrolling="true" 
    LoadingMessage="Loading..." EmptyMessage=""  >
</telerik:RadComboBox>

此方法具有重要的缺点,您无法快速设置SelectedValue并查看所选文本,但是telerik已经提出了一个解决方案,他们已经使用示例代码发布了该解决方案。 (见:Setting an initial value in RadComboBox while using Load on Demand

相关问题