473,378 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 1215

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: | last post by:
Hello, I have a GridView in my ASP.NET 2.0 application that performs the paging feature perfect when I have it bound to a data source. But now I have it bound to a dataset and the paging...
0
by: NH | last post by:
I know how to make client side paging work in the gridiew control using a sqlDataSource (and it works great!). But how can I "code" this i.e. I want to use a dataset as the datasource of the...
1
by: davidjgonzalez | last post by:
I have a GridView that has paging enabled. Each item (as defined in an ItemTemplate) includes several controls which have operations i would like to Atlas-enable. Everything is working well except...
3
by: Marc Grutte | last post by:
Hi I am trying to bind a custom datasource to a gridview whilst paging is enabled. What is missing in this code to make the paging + binding work? thanks M <%@ Page Language="VB" %>
2
by: ami | last post by:
In my code, I need to implement x numbers of Gridviews dynamically based on user selection. Because I am unaware of the number of gridviews, this is done after the user enters input. I need to...
1
by: ABHIJIT B | last post by:
Hi, I am using 2 web pages parent and popup.PopUp window is opened using window.showModalDialog().This is client requiremnt they don't wnat window.open() In PopUp page I am using GridView and...
1
by: suganya | last post by:
I have displayed the data from the DB to the GridView made a column in the GridView as HyperLink allowed paging by setting the Allow Paging Property to "True". By clicking on the page no link I have...
0
by: Sobin Thomas | last post by:
Hi All, How can I bind the Gridview control to Sql Datasource control on a button click(I see majority of the articles binding datasource at page load) I need to enable the paging and sorting of...
1
by: Sobin Thomas | last post by:
Hi All, How can I bind the Gridview control to Sql Datasource control on a button click(I see majority of the articles binding datasource at page load) I need to enable the paging and sorting of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.