Solved

GridView Footer not showing

Posted on 2013-01-28
9
303 Views
Last Modified: 2013-01-29
Hello;

I have a label in a gridview footer. When I load the page, the gridview shows fine but the footer does not.

    <asp:GridView ID="ViewResults" Font-Names="Arial" Font-Size="Small" AutoGenerateColumns="false" runat="server">
    <Columns>
    <asp:TemplateField>
    <FooterTemplate>
    <asp:Label ID="FooterLabel" Font-Names="Arial" Font-Size="Small" runat="server" />
    </FooterTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>

    protected void ViewResults_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Footer)
        {
            Label FooterLabel = (Label)e.Row.FindControl("FooterLabel");
            FooterLabel.Text = "Copyright 2013. All Rights Rerserved";
        }
    }

Open in new window

0
Comment
Question by:RecipeDan
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 35

Expert Comment

by:Miguel Oz
ID: 38829216
Set ShowFooter = True (grid view property) to render a footer row at the bottom of the grid view
Check:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.showfooter.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1
0
 
LVL 1

Author Comment

by:RecipeDan
ID: 38829389
It still does not show...
0
 
LVL 35

Expert Comment

by:Miguel Oz
ID: 38829867
Event handler is not attached.
<asp:GridView 
 //...    
onrowdatabound="ViewResults_RowDataBound">

Open in new window

0
 
LVL 10

Expert Comment

by:Monica P
ID: 38829895
code :  GridView1.ShowFooter = true;

or

aspx:  <asp:GridView ID="GridView1"  ShowFooter="True">
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:nitinismast
ID: 38830141
<asp:GridView ShowFooter="True|False" />
0
 
LVL 10

Expert Comment

by:Monica P
ID: 38830668
0
 
LVL 4

Expert Comment

by:Srinivasulu Muppala
ID: 38832286
check any css is blocking your footer.
0
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 38832859
Just to clarify my previous 2 posts you have to use both changes:(Property and event)
<asp:GridView 
 //...other properties    
ShowFooter="True" onrowdatabound="ViewResults_RowDataBound">

Open in new window

0
 
LVL 1

Author Closing Comment

by:RecipeDan
ID: 38833046
Works Great! Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now