473,569 Members | 2,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

In a data grid when the user clicks the "Next" or "Previous" navigational
links I am getting the above error message.

That happens only in the following scenarios.

1.. I am listing all the search results in the grid.
2.. User clicks the next button. Next set of result will be displayed.
3.. User clicks the hyperlink on the grid cell. Take the user to a
different page.
4.. User clicks the browser back button.
5.. Clicks the "Next" button on the grid.
6.. The above error occurs.
The search result gird has more than 100 pages. What I am saying is the
currentPageInde x I am setting here is with in the range as specified in the
error message.

Why I am getting the above error. How to resolve it?

I am on .Net Framework 1.1.

Thanks,

Smith


Nov 19 '05 #1
2 4012
before Binding Data to grid

write

this.datagrid1. currentpageinde x = 0
i used this and my problem was solved.
Apr 26 '07 #2
follow this link to find out the reason why this happens
http://support.microsoft.com/default...b;en-us;555074

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
"sabiha sonaseth" <sa****@yahoo.c omwrote in message
news:9f******** *************** *******@ureader .com...
before Binding Data to grid

write

this.datagrid1. currentpageinde x = 0
i used this and my problem was solved.

Apr 27 '07 #3

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

Similar topics

3
14616
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 12345678910 3. the first page shows 10 records 4. if do a keyword search on the full dataset the selected records are returned...I can repeat this many...
0
1346
by: Kelvin | last post by:
Hi all, I have to using 2 radiobuttons to control 2 datagrid summay and detail representively. when I click detail radionbutton, there are 10 pages records. when I click summary radiobutton, I select 3rd pages it display the following error. In the summary report just only 1 page record. "System.Web.HttpException: Invalid...
0
1070
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 page record. When I click summary radiobutton, I select 3rd pages it display the following error. "System.Web.HttpException: Invalid...
1
2179
by: Kelvin | last post by:
Hi All, I try to use the following microsft resolution web site, but still have same problem. http://support.microsoft.com/default.aspx?scid=kb;en-us;555074 I put the source code on "DataGrid_setPage" try
1
1485
by: Kelvin | last post by:
Hi All, "disable view state for the datagrid." How to do that ? Please advise ! Here is also attached my sources code ------------------------------------------- void DetailGrid_setPage ( Object src, DataGridPageChangedEventArgs e ) {
0
1106
by: jm | last post by:
I get this error when I click one of the datagrids pages: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. It is not doing this on the submit as I have this: Sub submit(Source As Object, e As EventArgs) if page.IsValid then MyDataGrid.CurrentPageIndex = 0 BindData()
2
1382
by: Sandy | last post by:
Hello - I have a datagrid and a dropdownlist (which is outside the datagrid). When I click on a category in the dropdownlist, the datagrid changes to correspond to that category. The datagrid is paged. If the pager is not on the first page, I receive the following error: "Invalid currentPageIndex value. It must be >= 0 and <...
3
1579
by: JackO | last post by:
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...
3
487
by: Franck | last post by:
Hello, in a datagrid, in the ItemDataBound event in some cells a add some javascript that show up an information strHref.Append("<A onclick=\"popupValid();\">"); strHref.Append("<span style=\"cursor:pointer\">"); strHref.Append(e.Item.Cells.Text+"</span></A>"); e.Item.Cells.Text=strHref.ToString();
0
1352
by: Antonio | last post by:
Hello, everyone. I am getting an "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount." error message when I click on the Edit button on any pages in the datagrid besides the first one. Can someone tell me what I am missing? The code highlighted with an error is: Line 204: adapter.Fill(ds); Line...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5501
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.