Click here to Skip to main content
15,917,062 members

Hi ,
You need to create a store proceudre where you can pass the start and end page index with total page size as how many record you need to display .check this links below which has details about how to create pagination with SP


http://www.aspsnippets.com/Articles/Custom-Paging-in-ASP.Net-GridView-using-SQL-Server-Stored-Procedure.aspx[^]

http://www.dotnetbull.com/2013/05/custom-paging-in-aspnet-using-stored.html[^]


http://dotnetawesome.blogspot.kr/2014/02/how-to-implement-custom-paging-in-gridview-using-stored-procedure.html[^]

not necessary code block removed
 
Share this answer
 
v2
Comments
Maciej Los 14-Apr-14 4:49am    
Sure, a5!
Hi,

1.you have get first time to get all record from table

then set paging in gridview like this

C#
<asp:gridview id="gv_test" gridlines="None" width="100%" runat="server" xmlns:asp="#unknown">
                                    AutoGenerateColumns="false" AllowPaging="true" PageSize="4" 
                                    OnPageIndexChanging="gv_test_PageIndexChanging">
                                    <columns>
                                        <asp:boundfield headertext="ID" datafield="ID" headerstyle-horizontalalign="Left">
                                            ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#0F0F0F" ItemStyle-BackColor="#1B1B1B"
                                            ItemStyle-Width="10%" />
                                         
                                    </asp:boundfield></columns>
                                    <pagerstyle horizontalalign="Right" />
                                </asp:gridview>
 
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