Click here to Skip to main content
15,867,945 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am using asp.net 2010 to build my web application, I am fetching data from database and displaying to gridview it has more than 300 rows, here i want to use paging.

I have given the properties AllowPaging = True and PageSize = 50,
In the design mode its showing page index like 1,2 in the bottom of the gridview, but when i am running in to the browser the gridview loading only 50 rows but not showing page index.


Please help..

thanks..
Posted

I hope This will Work


At Design Side:

<asp:gridview id="GridView1" runat="server" allowpaging="true" pagesize="50" onpageindexchanging="GridView1_PageIndexChanging">


At Coding Side:
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
// call here your Grid Bind Data Method
}
 
Share this answer
 
v2
Hi,

I found the solution myself.

I was trying to set some of the gridview cells visibility to false in RowCreated Event.After removal of this code gridview paging is working fine...


Thanks...
 
Share this answer
 
 
Share this answer
 
Comments
Ayyappan Ravi 11-Sep-13 11:27am    
No Its not happened...

page index is showing in the design mode but, not in the browser..
how much data in your table ???
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900