"Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount."

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

  1. #1

    Default "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount."

    Hello,
    in a datagrid, in the ItemDataBound event
    in some cells a add some javascript that show up an information

    strHref.Append("<A onclick=\"popupValid();\">");
    strHref.Append("<span style=\"cursor:pointer\">");
    strHref.Append(e.Item.Cells[1].Text+"</span></A>");

    e.Item.Cells[1].Text=strHref.ToString();


    if I had this when i ask for the next page (i'm using paging)
    i recieve the following error

    "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. "

    even if the values are the following:

    datagrid.currentpageindex=1
    datagrid.pagecount=2

    -----code----
    dgNivCompart.DataSource=tblCompart.DefaultView;
    dgNivCompart.CurrentPageIndex=intPageIndexGridNivC ompart;
    int huio=dgNivCompart.PageCount;
    dgNivCompart.DataBind();
    -----code----

    if i had nothing it work wells....
    Am I missing something?
    Franck Guest

  2. Similar Questions and Discussions

    1. the error "invalid plugin detected. Adobe Reader will quit"
      I have gotten the RIKLA from Adobe. And I use the example code BasicPlugin(you can download it from Adobe wetsite) as my plug_in, then, I made the...
    2. #40542 [NEW]: "ORA-02248: invalid option for ALTER SESSION" on OCIPLogon
      From: marvin at chag dot net Operating system: Linux PHP version: 5.2.1 PHP Bug Type: OCI8 related Bug description: ...
    3. "Invalid color" error every time Acrobat 7 is launched under Tiger
      Under 10.4.1, every time I launch Acrobat 7 Pro, I see messages like this in my system log: May 18 01:27:37 Muse /Applications/Adobe Acrobat 7.0...
    4. Invalid CurrentPageIndex value. It must be >= 0 and <the PageCount
      I get this message Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount After loading a datagrip with a single search cirteria from a...
    5. "viewstate is invalid for this page and might be corrupted" - why does worker process recycling cause this?
      Hi There, I have posted something previously regarding this issue, but I think I have some more concise questions to ask, and would like to get...
  3. #2

    Default Re: "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. "

    It's not related to the script. It's related to the total page size and the
    current page you are on. See this article
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;555074[/url]

    --
    Regards,
    Alvin Bruney [MVP ASP.NET]

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ [url]www.lulu.com/owc[/url]
    Forth-coming VSTO.NET - Wrox/Wiley 2006
    -------------------------------------------------------



    "Franck" <fh@fh.com> wrote in message
    news:dja7em$jge$2@s1.news.oleane.net...
    > Hello,
    > in a datagrid, in the ItemDataBound event
    > in some cells a add some javascript that show up an information
    >
    > strHref.Append("<A onclick=\"popupValid();\">");
    > strHref.Append("<span style=\"cursor:pointer\">");
    > strHref.Append(e.Item.Cells[1].Text+"</span></A>");
    >
    > e.Item.Cells[1].Text=strHref.ToString();
    >
    >
    > if I had this when i ask for the next page (i'm using paging)
    > i recieve the following error
    >
    > "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. "
    >
    > even if the values are the following:
    >
    > datagrid.currentpageindex=1
    > datagrid.pagecount=2
    >
    > -----code----
    > dgNivCompart.DataSource=tblCompart.DefaultView;
    > dgNivCompart.CurrentPageIndex=intPageIndexGridNivC ompart;
    > int huio=dgNivCompart.PageCount;
    > dgNivCompart.DataBind();
    > -----code----
    >
    > if i had nothing it work wells....
    > Am I missing something?

    Alvin Bruney - ASP.NET MVP 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