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

F

Franck

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=intPageIndexGridNivCompart;
int huio=dgNivCompart.PageCount;
dgNivCompart.DataBind();
-----code----

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

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top