PDA

View Full Version : pagnination problem in datagrid



Rahul Phalak
07-13-2006, 07:46 AM
Hi

i am populating a datagrid on the selection of a dropdown. for pagination i am using the datagrid pagination only. suppose on the datagrid i am on 5th page and i change the datagid populating dropdown its showing error message asking that the page index should be =>0 and <= page count.

so please help me out in this code...

Thanks
rahul

jr_yeo
07-13-2006, 11:59 AM
could u post EXACTLY the error message? :p

Rahul Phalak
07-19-2006, 07:16 AM
Suppose on load its showing 15 records and i have 3 records on each page. And using datagrid default pagination i seen 4 pages so my current page index will be 11. so now when i change the dropdown selection for another records .. its current page index need to set to zero. but its 11 so its showing following error message...

System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. at System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.BaseDataList.DataBind() at IPP_Portal.Awards_Recognition.Awards_Info(String sMod_Id, String Mod_name) in c:\inetpub\wwwroot\IPP_Portal\Awards_Recognition.aspx.vb:line 225

and line no 225 is
Dgawards.databind()

please give your input in this.. thanks a lot..
Rahul