0
我试图在我正在处理的应用程序中将分页添加到<asp:GridView>
。如何将分页添加到<asp:GridView>
这是我在遇到问题之前所尝试的。
<asp:LinqDataSource ID="Contacts" ContextTypeName="Xrm.XrmServiceContext" TableName="ContactSet" runat="server"/>
<asp:GridView ID="gvContacts" DataSourceID="Contacts" AutoGenerateColumns="false"
runat="server" GridLines="None" CssClass="table table-hover table-striped"
UseAccessibleHeader="true" OnPreRender="gvContacts_PreRender" AllowPaging="true" >
<!-- irrelevant grid view content -->
</asp:GridView>
如果你忽略了AllowPaging="true"
,一切工作正常(无分页功能)。只要我有AllowPaging="true"
我得到以下错误:
System.NotSupportedException: The method 'Count' is not supported.
如何添加分页(大小= 50)我<asp:GridView>
?我在错误的轨道上还是有我失踪的东西?