marc_butler
asked on
ASP:GridView Custom PagerTemplate
Hi All,
I wish to create a custom pager for my gridview. I have the First, Previous, Next and Last asp:Button working, but I want a page count in the middle of the buttons.
Can someone help please. :)
Marc
I wish to create a custom pager for my gridview. I have the First, Previous, Next and Last asp:Button working, but I want a page count in the middle of the buttons.
Can someone help please. :)
Marc
<PagerTemplate>
<asp:Button CommandName="Page" CommandArgument="First" ID="FirstButton" runat="server" CssClass="GridViewPagerButtonFirst" ToolTip="First Page" />
<asp:Button CommandName="Page" CommandArgument="Prev" ID="PrevButton" runat="server" CssClass="GridViewPagerButtonPrev" ToolTip="Previous Page" />
<asp:Button CommandName="Page" CommandArgument="Next" ID="NextButton" runat="server" CssClass="GridViewPagerButtonNext" ToolTip="Next Page" />
<asp:Button CommandName="Page" CommandArgument="Last" ID="LastButton" runat="server" CssClass="GridViewPagerButtonLast" ToolTip="Last Page" />
</PagerTemplate>
ASKER
Hi Informaniac,
Sorry I did explain my request very well. I was looking for a click-able list of page numbers i.e.
1 2 3 4 5
Im also programming in VB, so attached is my version of your above code.
Sorry I did explain my request very well. I was looking for a click-able list of page numbers i.e.
1 2 3 4 5
Im also programming in VB, so attached is my version of your above code.
Private Sub GV_CLAIMSELECT_DataBound(sender As Object, e As System.EventArgs) Handles GV_CLAIMSELECT.DataBound
Dim pagerRow As GridViewRow = GV_CLAIMSELECT.BottomPagerRow
Dim lblPageCount As Label = DirectCast(pagerRow.Cells(0).FindControl("lblPageCount"), Label)
lblPageCount.Text = GV_CLAIMSELECT.PageCount.ToString()
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Open in new window