Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

GridView Footer not showing

Posted on 2013-01-28
9
Medium Priority
?
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 36

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 36

Expert Comment

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

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 10

Expert Comment

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

or

aspx:  <asp:GridView ID="GridView1"  ShowFooter="True">
0
 

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 36

Accepted Solution

by:
Miguel Oz earned 2000 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

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.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

722 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