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

Problem with datagrid and page indexing

Hi

I have a grid that displays ok. I have activated page indexing, the code to
implement it is:

private void dGridSessionData_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEvent Args e)
{
dGridSessionData.CurrentPageIndex = e.NewPageIndex;
nxDataAdapterSessionData.Fill(nxDataAdapterSession Data_DataSet,
"sessiondata");
dGridSessionData.DataSource = nxDataAdapterSessionData_DataSet;
dGridSessionData.DataMember = "sessiondata";
dGridSessionData.DataBind();
}

When I run it, the grid displays with say four pages. But when I click on
'4' to go to the last page, page 4, sure enough it goes to page 4, but now
it is page 4 out of 6 pages!

Any ideas on what might be causing this behaviour and how I should fix it?

Thanks!

Lauchlan M
Nov 18 '05 #1
3 748
Look in the Property Builder (right-click on the grid in design mode). How
many numeric pages do you have it set for? Do you see a "..." at the end
when you first look at the 4-pages?

"Lauchlan M" <LM********@Hotmail.com> wrote in message
news:eu**************@TK2MSFTNGP09.phx.gbl...
Hi

I have a grid that displays ok. I have activated page indexing, the code to implement it is:

private void dGridSessionData_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEvent Args e)
{
dGridSessionData.CurrentPageIndex = e.NewPageIndex;
nxDataAdapterSessionData.Fill(nxDataAdapterSession Data_DataSet,
"sessiondata");
dGridSessionData.DataSource = nxDataAdapterSessionData_DataSet;
dGridSessionData.DataMember = "sessiondata";
dGridSessionData.DataBind();
}

When I run it, the grid displays with say four pages. But when I click on
'4' to go to the last page, page 4, sure enough it goes to page 4, but now
it is page 4 out of 6 pages!

Any ideas on what might be causing this behaviour and how I should fix it?

Thanks!

Lauchlan M

Nov 18 '05 #2
> Look in the Property Builder (right-click on the grid in design mode). How
many numeric pages do you have it set for?
What do you mean? I set it to 10 rows per page if that's what you mean.
Do you see a "..." at the end
when you first look at the 4-pages?


Well, say the data has 6 pages (there are page indexes for 6 pages), and I
click on the 6th page index, when it redraws the grid it then gives me 10
pages and the '...' . . .

Lauchlan M

Nov 18 '05 #3
Seems like your datasource increases. Do you see duplicated records after
paging?

Greetings
Martin
"Lauchlan M" <LM********@Hotmail.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
Look in the Property Builder (right-click on the grid in design mode). How many numeric pages do you have it set for?


What do you mean? I set it to 10 rows per page if that's what you mean.
Do you see a "..." at the end
when you first look at the 4-pages?


Well, say the data has 6 pages (there are page indexes for 6 pages), and I
click on the 6th page index, when it redraws the grid it then gives me 10
pages and the '...' . . .

Lauchlan M


Nov 18 '05 #4

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

Similar topics

8
by: John Baima | last post by:
I have an Access table that just consists of 2 columns: WordID (Autonumber, Primary key) and WordText (Text, Indexed, No dups). I've used this with a number of texts and languages without any...
1
by: Josema | last post by:
Hi, Im making a web custom datagrid of products. I have this piece of code in the override OnInit Method: ButtonColumn colbtn=new ButtonColumn(); ...
1
by: Joe Bloggs | last post by:
I am trying display the contents of a table in a web page, select certain rows from that table and then display the fields that I have selected (now table columns) as text in a Label object....
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
3
by: Lauchlan M | last post by:
Hi I have a grid that displays ok. I have activated page indexing, the code to implement it is: private void dGridSessionData_PageIndexChanged(object source,...
4
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated...
3
by: spilo101 | last post by:
I have a weird problem. Computer Hangs if same page is recompiled. -> Meaning that, say i created a very simple asp.net file, and called it from the browser. As we all know .NET will compile it...
0
by: Ken Varn | last post by:
I am sure this has been asked before, but I was wondering is there some way of getting the data values out of a DataGrid Item without having to resort to indexing into the item's cell collection? ...
3
by: Chris Lincoln | last post by:
I am currently working on a company site and have run into a problem with the search aspect of the site. I am running .net 2.0 and iis 5.1. The issue is as follows: Indexing Service is properly...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
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...
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
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.