The paging is working fine here, the problem is I don’t know how it works, because when I put a break point and a logger in the GetCustomers method, I found that parameters maximumRows and startRowIndex are always 0, 0.
I have no clue why StartRowIndexParameterName, and MaximumRowsParameterName are created and how they are used. If they are used in custom mode, so how to enter that mode?
Thanks
<body>
<form id="form1" runat="server">
<div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectCountMethod="Count"
SelectMethod="GetCustomers" TypeName="Pilots.BLL.Customer">
<SelectParameters>
<asp:Parameter Name="maximumRows" Type="Int32" />
<asp:Parameter Name="startRowIndex" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="true" PageIndex="0" PageSize="10"
DataSourceID="ObjectDataSource1">
</asp:GridView>
</div>
</form>
</body>
Those 2 parameters are used for custom paging on the gridview. That will be passed to SQL server to determine at what index to start the page (startRowIndex) and how many items on one gridview page (maximumRows).
The ‘startRowIndex’ will change depending on what the GridView.PageIndex is.
The number of rows returned from the method depends on what value set on ‘maximumRows’.