473,396 Members | 1,683 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,396 software developers and data experts.

Invalid Index in paging

I am getting the following error when I try to go to the second page of my
datagrid:

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount

I have searched the other logs on this error and the recommendation has been
to set the currentpageindex = 0. When I do this, it does not bring back the
records in the grid that I am expecting. In fact, it brings back no records
at all. My subroutine is:
Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e
As System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
DataGrid1.PageIndexChanged
'Change pages on the grid.
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataBind()
End Sub

Any sugestions on how to change my subroutine to get past this error would
be appreciated.
Nov 19 '05 #1
3 1568
Post the details of
DataBind()
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"JackO" wrote:
I am getting the following error when I try to go to the second page of my
datagrid:

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount

I have searched the other logs on this error and the recommendation has been
to set the currentpageindex = 0. When I do this, it does not bring back the
records in the grid that I am expecting. In fact, it brings back no records
at all. My subroutine is:
Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e
As System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
DataGrid1.PageIndexChanged
'Change pages on the grid.
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataBind()
End Sub

Any sugestions on how to change my subroutine to get past this error would
be appreciated.

Nov 19 '05 #2
I am not sure what you mean by Post the details of DataBind()

"vinay" wrote:
Post the details of
DataBind()
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"JackO" wrote:
I am getting the following error when I try to go to the second page of my
datagrid:

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount

I have searched the other logs on this error and the recommendation has been
to set the currentpageindex = 0. When I do this, it does not bring back the
records in the grid that I am expecting. In fact, it brings back no records
at all. My subroutine is:
Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e
As System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
DataGrid1.PageIndexChanged
'Change pages on the grid.
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataBind()
End Sub

Any sugestions on how to change my subroutine to get past this error would
be appreciated.

Nov 19 '05 #3
have a look at this article. It's not really a bug, but it is *fixed in 2.0
http://support.microsoft.com/default...b;en-us;555074

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"JackO" <Ja***@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
I am not sure what you mean by Post the details of DataBind()

"vinay" wrote:
Post the details of
DataBind()
--
http://pathidotnet.blogspot.com
=====
vInAypAtHi
o__
---_,>/'_------
(_) \(_)
---------------
"JackO" wrote:
> I am getting the following error when I try to go to the second page of
> my
> datagrid:
>
> Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount
>
> I have searched the other logs on this error and the recommendation has
> been
> to set the currentpageindex = 0. When I do this, it does not bring
> back the
> records in the grid that I am expecting. In fact, it brings back no
> records
> at all. My subroutine is:
>
>
> Private Sub DataGrid1_PageIndexChanged(ByVal source As Object,
> ByVal e
> As System.Web.UI.WebControls.DataGridPageChangedEvent Args) Handles
> DataGrid1.PageIndexChanged
> 'Change pages on the grid.
> DataGrid1.CurrentPageIndex = e.NewPageIndex
> DataBind()
> End Sub
>
> Any sugestions on how to change my subroutine to get past this error
> would
> be appreciated.
>
>

Nov 19 '05 #4

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

Similar topics

3
by: Meg | last post by:
Hi All, I am having a problem with paging in datagrid and need some idea as to how to handle the problem 1. the datagrid is first filled with a select * all 2. the datgrid shows 10 pages...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
0
by: Kelvin | last post by:
Hi all, I have to 2 radiobuttons to control 2 datagrid summay and detail representively. when I click detail radionbutton, In detail report 10 pages records. In the summary report just only 1...
1
by: david | last post by:
I have a question about paging index position. When I setup view position of paging index for DataGrid, I can only select the page index position at bottom or on the top. However, The .NET IDE...
0
by: Pat | last post by:
I have 3 Datagrid nested. Master Details Child The master has paging (And i'm using the paging inbuilt in the Datagrid) in the Master DataGrid you select a linkbutton(using commandname) and it...
3
by: uche | last post by:
Please give me some feed back on this issue: Here is the complier error: hexdmp.cpp: In function `void output(unsigned char, int, bool&)': hexdmp.cpp:133: error: invalid types `unsigned char'...
6
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added...
2
by: Chapi | last post by:
hi, i'm having problems with a datagrid paging. it's populates fine, but when i click the paging button appears this error:"Specified argument was out of the range of valid values.Parameter name:...
0
BeemerBiker
by: BeemerBiker | last post by:
I was wondering if a command like "SqlDataSource1.insert()" can somehow give me the new index that was created when the insert took place. If the insert always occurs at the end of the dataset then...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.