473,412 Members | 5,714 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,412 software developers and data experts.

Wierd DataGrid behaviour

Guys,

I have a datagrid that has paging, with the below code.

It _used_ to work, but now doesn't. No idea why.
However, if I put code breaks on the lines indicated with
*, I get the following results:

..DataBind: PageCount = 16, CurrentPageIndex = 2
..Write: PageCount = 1, CurrentPageIndex = 2

So, calling databind results in 15 pages disappearing, and
then this error:

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

Any ideas?

Simon.

private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEvent Args e)
{
System.Data.DataView dvData =
(System.Data.DataView)Session["myData"];
DataGrid1.DataSource = dvData ;
DataGrid1.CurrentPageIndex = e.NewPageIndex;
try
{
* DataGrid1.DataBind();
}
catch
{
* Response.Write("error");
}
}

Nov 17 '05 #1
0 890

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

Similar topics

2
by: Vaddina Prakash Rao | last post by:
Hi all .. I describe here a wierd behaviour .. i dont understand why ... This could be very stupid aswell .. so please bear me .. I have been writing a program to accept multiple parameters and...
0
by: Mauro | last post by:
Hi, I need a big help to resolve this problem. I need to put a usercontrol in a datagrid: this control check if the code inserted is present in a archive and if not return a error message. (In...
0
by: Danny | last post by:
I am trying to sort my second datagrid. And it works but only after i click 2 times on the column header. The first time i click on the header the data in the right order will add to the rows in...
7
by: Diane | last post by:
Hi- I've been struggling with this problem and none of the fixes posted seem to help out at all. Yet, it seems like such a simple problem... I have a DataGrid, and load it up with data on...
0
by: Michael | last post by:
Hi, I found a wierd problem in DataGrid. If I set DataGrid's DataSource to empDataSet1 at designtime, then I can never change its DataSource at runtime, e.g., in the Button1_Click event...
0
by: Tom | last post by:
Here is a very strange problem that I am stumped by. I have a rather large application written in VB.NET (of course) using Framework 1.1. As you know, with an MDI application you can have multiple...
5
by: Johs32 | last post by:
I have the follwing code: #include <stdio.h> #include <stdlib.h> struct data { int *ip; };
1
by: mfleet1973 | last post by:
Boy do I ever have one for you guys... I have multiple cells in my datagrid. If I click with my mouse on the any cell other than the first cell, the text in the cell that I clicked on gets the...
0
by: JoaquimC | last post by:
Hello, I'm new to c#, and i am trying to implement the following behaviour to a DataGrid: When i locate a record in one DataTable i want to select and show the respective grid row in the...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
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...
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.