【问题标题】:Telerik: LoadOnDemand not working proerplyTelerik:按需加载无法正常工作
【发布时间】:2013-01-27 02:44:15
【问题描述】:

我设置了一个 LinqDataSource 和一个 RadComboBox,以便组合框按需显示查询结果。该表有 1000 左右行,加载该页面需要很长时间,因为出于某种原因 RadComboBox 一直在加载所有内容。

那么下面的代码有什么问题呢?我对代码隐藏文件中的 cbAuto 一无所知

<asp:LinqDataSource ID="LinqDataSource1" runat="server" 
ContextTypeName="Webshop.Entities" EntityTypeName="" OrderBy="Name, FromDate, TillDate"
Select="new (AutoID, Name, FromDate, TillDate, Comment)" TableName="Autos">
</asp:LinqDataSource>

<telerik:RadComboBox ID="cbAutos" runat="server" Width="900px"
        DropDownWidth="900px" EmptyMessage="Chosse an autotype"
        HighlightTemplatedItems="True"
         Filter="Contains" LoadingMessage="Loading..." DataTextField="Name"
 MaxHeight="300px" DataValueField="AutoID" ShowDropDownOnTextboxClick="False"
DataSourceID="LinqDataSource1" EnableLoadOnDemand="True" EnableVirtualScrolling="True" 
ItemsPerRequest="100">
                            <HeaderTemplate>
                                <table style="width: 850px;">
                                    <tr>
                                        <td style="width: 300px;">Autotype</td>
                                        <td style="width: 100px;">Date (from)</td>
                                        <td style="width: 100px;">Date (till)</td>
                                        <td style="width: 150px;">Comment</td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table style="width: 850px;">
                                    <tr>
                                        <td style="width: 300px;">
                                            <%# DataBinder.Eval(Container.DataItem, "Name")%>
                                        </td>
                                        <td style="width: 100px;">
                                            <%# DataBinder.Eval(Container.DataItem, "FromDate")%>
                                        </td>
                                        <td style="width: 100px;">
                                            <%# DataBinder.Eval(Container.DataItem, "TillDate")%>
                                        </td>
                                        <td style="width: 150px;">
                                            <%# DataBinder.Eval(Container.DataItem, "Comment")%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </telerik:RadComboBox>

【问题讨论】:

    标签: asp.net linq telerik datasource


    【解决方案1】:

    请尝试另一个Radcombobox 属性EnableAutomaticLoadOndemand=true 这可以帮助您解决问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多