D
Dr.Gigabit
Hello all,
I try to implement custom paging for GridView and have the following
problem. I use TextBox field to display the current page.
<PagerTemplate>
.....
<asp:TextBox ID="CurrentPageNumber" Width="15px" runat="server" />
of <%= GridView1.PageCount %>
.....
</PagerTemplate>
And I use the following code to change the page's number
protected void GridView1_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
// Retrieve the pager row.
GridViewRow pagerRow = GridView1.BottomPagerRow;
TextBox txtCurrentPage =
(TextBox)pagerRow.FindControl("CurrentPageNumber");
txtCurrentPage.Text = e.NewPageIndex.ToString();
}
But the number is only displayed on the last page?
Could anybody explain this behaviour?
Tnanks in advance!
I try to implement custom paging for GridView and have the following
problem. I use TextBox field to display the current page.
<PagerTemplate>
.....
<asp:TextBox ID="CurrentPageNumber" Width="15px" runat="server" />
of <%= GridView1.PageCount %>
.....
</PagerTemplate>
And I use the following code to change the page's number
protected void GridView1_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
// Retrieve the pager row.
GridViewRow pagerRow = GridView1.BottomPagerRow;
TextBox txtCurrentPage =
(TextBox)pagerRow.FindControl("CurrentPageNumber");
txtCurrentPage.Text = e.NewPageIndex.ToString();
}
But the number is only displayed on the last page?
Could anybody explain this behaviour?
Tnanks in advance!