Paging problem

  • Thread starter Andrea Williams
  • Start date
A

Andrea Williams

I have a datagrid that only shows 2 items per page. The page numbers appear
at the bottome of each page for the user to page through the list. It shows
1 through 10 and then a "..." link. If I click the "..." link I can see
page numbers 11 through 20 and another "..." link. However if I cllick that
link, it sends me back to the first 1 through 10 pages instead of 21 through
30. I know there are enough items that 34 pages should show up. So what is
the problem?

also, any of the numbers that I click from 11 to 20 send me back to the
corresponding number in the 1 through 10 pages... It seems like it's not
returning the correct numbers to the paging handler...

Code is as follows:

private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEventArgs e)

{

this.DataGrid1.CurrentPageIndex = e.NewPageIndex;

if (this.mdsDataSource != null)

this.DataGrid1.DataBind();

}
 
E

Elton Wang

Hi Andrea,

Probably the EnableViewState of your datagrid is false. If
so, change it to true.

HTH

Elton Wang
(e-mail address removed)
 
A

Andrea Williams

That's not it, it's already set to true by default and I have not changed
it.

Andrea
 
E

Elton Wang

Generally when paging you should re-bind datagrid with its
data source. I can't see anything else wrong.

HTH

Elton Wang
 
H

Hordur Hreinsson

Hey,

I have the same problem. Very mysterious. It's the links with postback that have wrong postback information... When you are at the ... 11 12 ... 19 20 ... links then they have the same postback information as 1 2 ... 9 10 ... which means that if you press 11 it will go to page 2 if you press 15 it will go to page 6.

The question is, why does it generate the same postbacks in both places.

If you found the aswer please post it here.

Hördur.

From http://www.developmentnow.com/g/12_2005_4_0_0_371810/Paging-problem.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top