Solved

GridView Footer not showing

Posted on 2013-01-28
9
335 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

635 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