Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

As i am new to asp .net, I have a problem of displaying buttons at the bottom of Grid View. for the sake of Next and Previous purpose..
I dont want to use built in buttons of grid view...
Posted

 
Share this answer
 
Comments
Prashant Srivastava LKO 20-Jan-12 6:17am    
nice link my 5
have a look at the following:
GridView Custom Paging[^]
 
Share this answer
 
Comments
Prashant Srivastava LKO 20-Jan-12 6:17am    
nice link my 5
hi,

You can use the Pagertemplate of gridview and put whatever you want in that
it will take

C#
<pagertemplate>
<table width="100%">
<tr>
<td width="35%"</td>
<td align="left" style="display:none">
<asp:Label runat="server" ID="lblNumberPages" Text="Display Items: 15" CssClass="arial10grey">    
<asp:DropDownList runat="server" ID="dlstNumberPages" AutoPostBack="true" Visible="false">
<asp:ListItem Text="5">
<asp:ListItem Text="10">
<asp:ListItem Text="15" Selected="True">
<asp:ListItem Text="20">

</td>
                                                                                    
<td align="center">
<asp:LinkButton runat="server" ID="lnkNumberFirst" CssClass="arial10grey" Text="<<"
CommandArgument="First" CommandName="Page" OnClick="lnkNumberFirst_Click" Visible="false"> 
<asp:LinkButton runat="server" ID="lnkNumberPrev" CssClass="arial10grey" Text="Previous" CommandArgument="Prev" CommandName="Page" OnClick="lnkNumberPrev_Click" Visible="false"> 
<asp:LinkButton runat="server" ID="lnkNumberNext" CssClass="arial10grey" Text="Next" CommandArgument="Next" CommandName="Page" OnClick="lnkNumberNext_Click"> 
<asp:LinkButton runat="server" ID="lnkNumberLast" CssClass="arial10grey" Text=">>" CommandArgument="Last" CommandName="Page" OnClick="lnkNumberLast_Click">
</td>
                                                                                    
<td align="right">
<asp:Label runat="server" ID="lblNumberPageno" Text="go to page" CssClass="arial10grey">
<asp:DropDownList runat="server" ID="dlstNumberPageno" AutoPostBack="true" OnSelectedIndexChanged="dlstNumberPageno_SelectedIndexChanged" CssClass="arial10grey">
    
</td>
                                                                                    
</tr>
</table>
</pagertemplate>
 
Share this answer
 
v4
Hi,
you can use button image in pager setting property of grid view . First enable "Allow Paging property" . After that , In Pager setting property , you will pass the image url for FirstPageImageUrl , LastPageImageUrl, NextPageImageUrl and PreviousPageImageUrl .

Hope So It will work for you .....
 
Share this answer
 
v3

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