Solved

GridView Footer not showing

Posted on 2013-01-28
9
312 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question! 4 36
How to close an asp.net web form using C# ? 4 30
performance issue in asp web 5 32
C# LINQ ForEach() question 6 28
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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