Gary King

Gary King

  • NA
  • 83
  • 159k

GridView PagerTemplate - How do I add text?

Dec 6 2010 12:11 PM

Hi,
I have a GridView with Paging enabled so that it displays 1 2 3 4 etc, etc at the bottom (left aligned).
What I want to do is to keep this as it currently is and add a HyperLink which is on the same row and right aligned.
Is this possible? I have tried various solutions which just haven't given me what I want. The nearest I got was with the code below, but this puts the HyperLink on a new row under the page number links....


if (e.Row.RowType == DataControlRowType.Pager)
   {
         
HyperLink hlink = new HyperLink();
         hlink.NavigateUrl =
"AnotherPage.aspx";
         hlink.Text =
"PageTitle";
         e.Row.Cells[0].Controls.Add(hlink);
   }
 

Answers (1)