More problem with paging GridView

J

Jeff

hi there ;)

asp.net 2.0

I'm having problem with paging in GridView, I'm using custom paging. The
ObjectDataSource reads in the rows needed for displaying each page as each
page is selected. So that the entire resultset isn't read, but instead just
enough to display the pages.

The problem now is that the GridView is only displaying the 2 rows, The
GridView contain 3 pages, it doesn't matter what page I click on, because
the GridView displays the same rows on every page. I want the GridView to
display different rows on different pages - Normal behavior... Other thing
that is strange with my GridView is that after I've clicked on the different
pages for a while then it starts to display only 1 row on each page... And
if I do even more clicking on different pages it starts to display no rows
at all

This is the top markup of the GridView:
<asp:GridView ID="gvwCars"
Width="100%"
BorderWidth="0"
runat="server"
AllowPaging="true"
AllowSorting="true"
PageSize="2"
AutoGenerateColumns="false"
ShowHeader="false"
DataKeyNames="Id"
DataSourceID="odsCars"
OnRowDataBound="gvwCars_RowDataBound">
<Columns>

Here is the markup of the ObjectDataSource:
<asp:ObjectDataSource ID="odsCars"
TypeName="BLL.Car"
MaximumRowsParameterName="maximumRows"
StartRowIndexParameterName="startRowIndex"
SelectMethod="GetCars" SelectCountMethod="GetCarsCount"
EnablePaging="true"
runat="server" >
<SelectParameters>
<asp:parameter DefaultValue="false" Type="Boolean" Name="sorttype" />
<asp:parameter DefaultValue="false" Type="Boolean" Name="approved" />
<asp:parameter DefaultValue="10" Type="Int32" Name="maximumRows" />
<asp:parameter DefaultValue="0" Type="Int32" Name="startRowIndex" />
</SelectParameters>
</asp:ObjectDataSource>

any suggestions how to fix this? also PageSize=2 (GridView) does that mean
that the value 2 is copied over MaximumRowsParameterName, I don't see in
other ways the value 2 can be transferred to the ods. I don't specify 2 any
other place..

Best Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top