Click here to Skip to main content
Sign Up to vote bad
good
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:20
Ruwaldo774
Edited 2 Aug '12 - 1:26


1 solution

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...
  Permalink  
Comments
Ruwaldo - 3 Aug '12 - 8:20
Thanks for the answer, the first link is what i needed to see.
Tadit Dash - 6 Aug '12 - 4:54
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
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 425
1 OriginalGriff 330
2 Arun Vasu 253
3 Zoltán Zörgő 194
4 CPallini 173
0 Sergey Alexandrovich Kryukov 10,105
1 OriginalGriff 7,739
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 2,999


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 3 Aug 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid