Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Juan Romero #1
unexpected behavior in Datagrid paging : PLEASE HELP >: (
Hi guys,
Background:
I have a grid that is bound to a table in a dataset. On first load the
command of the SQLAdapter is configured to get all the records. I also have
a calendar control on the page that changes the SQLAdapter's select command
based on the date range the user selects on the calendar, and rebinds the
datagrid.
When I change the date, the datagrid is refreshed with the new data (new
round trip) and it displays records accordingly. Paging is set to 20 records
per page. I get the value of the recordcount, and it has for example 25
records (2 pages). The link for next page is active since there are 2 pages,
so everything looks fine up to that.
The Problem:
When I click on the "Next page" link of the datagrid, I get the following
error:
"pageindex must be > -1 and < PageCount"
WHY IS THIS HAPPENING?
I mean, the dataset has enough rows for 2 pages, which is why the datagrid
displays the next page link, but when my code tries to set the pageindex
property it gives me this error.
I must also mention that when the grid loads by default the first time with
all the records, the code that changes the pageindex property works fine, no
errors. It is only happening after I change the data to be loaded.
I know I must be missing something, please help. This is a time sensitive
project.
Thanks in advance!
Juan Romero Guest
-
Unexpected resolver behavior
I'm running 4.10-p5 on my workstation at home, and I can't understand why I cannot get www.foo.com to resolve to an IP I am specifying in... -
unexpected datagrid behavior
I am writing a control that prints any datagrid using Crystal reports. My control gets passed a datagrid object and examines it, formats, and... -
#25740 [Opn->Bgs]: strstr unexpected behavior
ID: 25740 Updated by: sniper@php.net Reported By: daijoubu at videotron dot ca -Status: Open +Status: ... -
Unexpected behavior
Has anyone seen this one before? I have code that has to run in production and test environments and access datafrom two databases in a single... -
Unexpected behavior of signal catcher
In article <bef05n$ilm$1@reader1.panix.com>, Stan Brown <stanb@panix.com> wrote: : sub catch_zap { : my $signame = shift; : ... -
Alvin Bruney #2
Re: unexpected behavior in Datagrid paging : PLEASE HELP >: (
I've posted elsewhere long ago that i believe this to be a bug. you can work
around this by catching the error and resetting the pageindex = 0
it is happening because the pageindex and the item collection for the page
become out of sync basically
"Juan Romero" <juanja01@optonline.net> wrote in message
news:eA$wru8dDHA.3428@tk2msftngp13.phx.gbl...have> Hi guys,
>
> Background:
> I have a grid that is bound to a table in a dataset. On first load the
> command of the SQLAdapter is configured to get all the records. I alsocommand> a calendar control on the page that changes the SQLAdapter's selectrecords> based on the date range the user selects on the calendar, and rebinds the
> datagrid.
> When I change the date, the datagrid is refreshed with the new data (new
> round trip) and it displays records accordingly. Paging is set to 20pages,> per page. I get the value of the recordcount, and it has for example 25
> records (2 pages). The link for next page is active since there are 2with> so everything looks fine up to that.
>
> The Problem:
> When I click on the "Next page" link of the datagrid, I get the following
> error:
> "pageindex must be > -1 and < PageCount"
>
> WHY IS THIS HAPPENING?
>
> I mean, the dataset has enough rows for 2 pages, which is why the datagrid
> displays the next page link, but when my code tries to set the pageindex
> property it gives me this error.
>
> I must also mention that when the grid loads by default the first timeno> all the records, the code that changes the pageindex property works fine,> errors. It is only happening after I change the data to be loaded.
>
> I know I must be missing something, please help. This is a time sensitive
> project.
>
> Thanks in advance!
>
>
Alvin Bruney Guest



Reply With Quote

