Click here to Skip to main content
Rate this: bad
good
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();
                td.Controls.Add(label);              
                e.Row.Cells.Add(td);             
        }
    }
Posted 2-Aug-12 0:20am
Ruwaldo732
Edited 2-Aug-12 1:26am
v2

1 solution

Rate this: bad
good
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 [^].
Thanks...
Comments
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 Sergey Alexandrovich Kryukov 483
1 Maciej Los 360
2 OriginalGriff 308
3 Yogesh Kumar Tyagi 275
4 CHill60 220
0 OriginalGriff 6,367
1 Sergey Alexandrovich Kryukov 5,296
2 Maciej Los 3,384
3 Peter Leow 3,259
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web04 | 2.8.140721.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