Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP
Hi all, i'm new at web development and have a problem. I have gridview with
pager Next/Previous buttons and they are at the bottom right of the grid(PagerStyle HorizontalAlign="Right"). How do i add a label to the bottom left of the grid but in the same row as the pager?...I have tried this but it adds the label to right of the pager buttons and the label doesnt look like its inside the grid.
protected void DistributionGrid_RowCreated(object sender, GridViewRowEventArgs e)
        if (e.Row.RowType == DataControlRowType.Pager)
        { Label label = new Label();
                label.ID = "lbResult";
                label.Text = "Showing results";
                label.CssClass = "results";
                TableCell td = new TableCell();
Posted 2-Aug-12 0:20am
Edited 2-Aug-12 1:26am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Nice Question (Rated 5 stars)...
I have learnt a lot while working this out...
For this you can use the GridView's PagerTemplate[^] property. (The link here has an example that does close to what you want...).
You just have to write the controls you need inside PagerTemplate tags.
Do also check another example at PagerTemplate not showing in GridView [^].
Ruwaldo at 3-Aug-12 8:20am
Thanks for the answer, the first link is what i needed to see.
Tadit Dash at 6-Aug-12 4:54am
Great... So you did what you needed. It was a nice question indeed...
Thanks... Happy Coding...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CHill60 330
1 OriginalGriff 285
2 Sergey Alexandrovich Kryukov 274
3 BillWoodruff 170
4 Aescleal 140

Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 3 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100