unexpected behavior in Datagrid paging : PLEASE HELP >: (

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. #25740 [Opn->Bgs]: strstr unexpected behavior
      ID: 25740 Updated by: sniper@php.net Reported By: daijoubu at videotron dot ca -Status: Open +Status: ...
    4. 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...
    5. 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; : ...
  3. #2

    Default 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...
    > 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!
    >
    >

    Alvin Bruney Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139