473,385 Members | 1,610 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,385 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 993
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,...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
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,...

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.