Click here to Skip to main content
12,405,088 members (71,940 online)
Rate this:
 
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
Ruwaldo735
Updated 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 3-Aug-12 8:20am
   
Thanks for the answer, the first link is what i needed to see.
Tadit Dash 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 3 Aug 2012
Copyright © CodeProject, 1999-2016
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