• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

GridView Footer not showing

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
RecipeDan
Asked:
RecipeDan
  • 3
  • 2
  • 2
  • +2
1 Solution
 
Miguel OzSoftware EngineerCommented:
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
 
RecipeDanAuthor Commented:
It still does not show...
0
 
Miguel OzSoftware EngineerCommented:
Event handler is not attached.
<asp:GridView 
 //...    
onrowdatabound="ViewResults_RowDataBound">

Open in new window

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Monica PSoftware DeveloperCommented:
code :  GridView1.ShowFooter = true;

or

aspx:  <asp:GridView ID="GridView1"  ShowFooter="True">
0
 
nitinismastCommented:
<asp:GridView ShowFooter="True|False" />
0
 
Monica PSoftware DeveloperCommented:
0
 
Srinivasulu MuppalaLead DeveloperCommented:
check any css is blocking your footer.
0
 
Miguel OzSoftware EngineerCommented:
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
 
RecipeDanAuthor Commented:
Works Great! Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now