Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Paging on Datagrid Does Not Work

Reply
Thread Tools

Paging on Datagrid Does Not Work

 
 
Bruce LeMond
Guest
Posts: n/a
 
      09-29-2003
This is a Visual Basic web form. I set the datagrid
properties to allow for paging with 10 rows displayed per
page. When I run and click on the Next button (>), it
does not go to the next page. There are more than 10 rows
to be displayed. Anyone knows why this is not working?

Thanks in advance.
 
Reply With Quote
 
 
 
 
vMike
Guest
Posts: n/a
 
      09-29-2003
Make sure you have AllowPaging=True

"Bruce LeMond" <(E-Mail Removed)> wrote in message
news:1849a01c386af$1d703ec0$(E-Mail Removed)...
> This is a Visual Basic web form. I set the datagrid
> properties to allow for paging with 10 rows displayed per
> page. When I run and click on the Next button (>), it
> does not go to the next page. There are more than 10 rows
> to be displayed. Anyone knows why this is not working?
>
> Thanks in advance.



 
Reply With Quote
 
 
 
 
Bruce LeMond
Guest
Posts: n/a
 
      09-29-2003
I checked and the allowPaging is set to TRUE. But I
discovered that I needed to add this coding:

Private Sub DataGrid1_PageIndexChanged(ByVal source As
Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEvent Args)
Handles DataGrid1.PageIndexChanged
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataGrid1.DataBind()
End Sub

But when I added this code and ran, I received this
following error message:

System.Web.HttpException: Invalid CurrentPageIndex value.
It must be >= 0 and < the PageCount.

Could you think of anything else?

Thanks,
Bruce
>-----Original Message-----
>Make sure you have AllowPaging=True
>
>"Bruce LeMond" <(E-Mail Removed)> wrote in message
>news:1849a01c386af$1d703ec0$(E-Mail Removed)...
>> This is a Visual Basic web form. I set the datagrid
>> properties to allow for paging with 10 rows displayed

per
>> page. When I run and click on the Next button (>), it
>> does not go to the next page. There are more than 10

rows
>> to be displayed. Anyone knows why this is not working?
>>
>> Thanks in advance.

>
>
>.
>

 
Reply With Quote
 
Slawek
Guest
Posts: n/a
 
      09-30-2003
Hi,
I think that you should check when you fill dataset because exception that
you receive means that there is no second page in dataset (there is less
then 10 rows). When you open page for the first time - there is more then 10
rows (becouse next button appear), but click on the "next" link to reloads
page and probably after reload you don't fill dataset.
Check if there is no code like this :
if(! IsPostback)
{
//fill of your dataset
}

I think that this is your problem

Regards
Slawek


"Bruce LeMond" <(E-Mail Removed)> wrote in message
news:11c301c386d4$4140f270$(E-Mail Removed)...
> I checked and the allowPaging is set to TRUE. But I
> discovered that I needed to add this coding:
>
> Private Sub DataGrid1_PageIndexChanged(ByVal source As
> Object, ByVal e As
> System.Web.UI.WebControls.DataGridPageChangedEvent Args)
> Handles DataGrid1.PageIndexChanged
> DataGrid1.CurrentPageIndex = e.NewPageIndex
> DataGrid1.DataBind()
> End Sub
>
> But when I added this code and ran, I received this
> following error message:
>
> System.Web.HttpException: Invalid CurrentPageIndex value.
> It must be >= 0 and < the PageCount.
>
> Could you think of anything else?
>
> Thanks,
> Bruce
> >-----Original Message-----
> >Make sure you have AllowPaging=True
> >
> >"Bruce LeMond" <(E-Mail Removed)> wrote in message
> >news:1849a01c386af$1d703ec0$(E-Mail Removed)...
> >> This is a Visual Basic web form. I set the datagrid
> >> properties to allow for paging with 10 rows displayed

> per
> >> page. When I run and click on the Next button (>), it
> >> does not go to the next page. There are more than 10

> rows
> >> to be displayed. Anyone knows why this is not working?
> >>
> >> Thanks in advance.

> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paging in DataGrid does not work 2.. princessjewel62@gmail.com ASP .Net Web Controls 0 11-07-2006 03:45 AM
Paging does not work in a dynamic DataGrid js ASP .Net 5 07-08-2005 07:00 AM
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
datagrid paging - customising paging style wh1974 ASP .Net 0 01-12-2005 03:48 PM
Can anyone explain why paging does not work if AutoGenerateColumns = false!!?!?!?!?! pietaster ASP .Net Datagrid Control 1 10-28-2003 03:42 PM



Advertisments