468,104 Members | 1,305 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,104 developers. It's quick & easy.

More problem with paging GridView

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
Oct 21 '08 #1
0 1014

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by NH | last post: by
1 post views Thread by davidjgonzalez | last post: by
3 posts views Thread by Marc Grutte | last post: by
1 post views Thread by ABHIJIT B | last post: by
1 post views Thread by suganya | last post: by
reply views Thread by Sobin Thomas | last post: by
1 post views Thread by Sobin Thomas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.