473,405 Members | 2,404 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,405 software developers and data experts.

paging problem

Why would this not work?
//
Private Sub nNext_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles nNext.Click
dgTopTen.CurrentPageIndex += 1
dgTopTen.DataBind()
End Sub
\\

I get this error message here: Invalid CurrentPageIndex value. It must be >=
0 and < the PageCount

I have also tried something like this:
//
Private Sub dgHistory_PageIndexChanged(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
dgHistory.PageIndexChanged
dgTopTen.CurrentPageIndex = e.NewPageIndex
dgTopTen.DataBind()
End Sub
\\

With this one my first 5 records are still shown.

I am all new to this so I appreciate and thank you for the help in what I am
missing.

Brad

Nov 19 '05 #1
1 933
Hi Brad,

In order to page, you need re-bind datagrid's data source:

dgTopTen.CurrentPageIndex = e.NewPageIndex
dgTopTen.DataSource = GetDataSource ' Get data source from
Session or db
dgTopTen.DataBind()

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
Why would this not work?
//
Private Sub nNext_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles nNext.Click
dgTopTen.CurrentPageIndex += 1
dgTopTen.DataBind()
End Sub
\\

I get this error message here: Invalid CurrentPageIndex value. It must be >=0 and < the PageCount

I have also tried something like this:
//
Private Sub dgHistory_PageIndexChanged(ByVal sender As Object, ByVal e AsSystem.Web.UI.WebControls.DataGridPageChangedEven tArgs) HandlesdgHistory.PageIndexChanged
dgTopTen.CurrentPageIndex = e.NewPageIndex
dgTopTen.DataBind()
End Sub
\\

With this one my first 5 records are still shown.

I am all new to this so I appreciate and thank you for the help in what I ammissing.

Brad

.

Nov 19 '05 #2

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

Similar topics

2
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
7
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla,...
1
by: =?Utf-8?B?TG95b2xhIHN0YWxpbg==?= | last post by:
Hi, I am using ASP.Net 2.0 version and Windows'XP OS. I am useing the Grid view control to display the user details along with the paging concept provided by the grid view control. When i...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.