Ho un GridView sullo schermo e ne ho bisogno per consentire il paging.L'origine dati non supporta l'impaginazione dei dati lato server
Markup:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataSourceID="ObjectDataSource1">
<Columns>
<asp:BoundField DataField="appID" HeaderText="appID" SortExpression="appID" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetBookingId"
TypeName="AppointmentRepository">
<SelectParameters>
<asp:Parameter Name="maximumRows" Type="Int32" />
<asp:Parameter Name="startRowIndex" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
Codice-behind:
ObjectDataSource1.SelectParameters["maximumRows"].DefaultValue = "10";
ObjectDataSource1.SelectParameters["startRowIndex"].DefaultValue = "0";
query LINQ:
public IQueryable<tblAppointment> GetBookingId(int maximumRows, int startRowIndex)
{
var result = (FROM a IN dc.tblAppointments
SELECT a).Skip(startRowIndex).Take(maximumRows);
}
Tuttavia ricevo questo errore:
The data source does not support server-side data paging.
Cosa sto sbagliando?