Solved

How to show button in GridView when there is no data in it.

Posted on 2013-01-28
5
173 Views
Last Modified: 2013-06-08
How to show button and columns in GridView when there are no rows in it.Because i cannot see any data.
0
Comment
Question by:sarang8180
[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
5 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 38825881
Tip/Trick: Show Header and Footer of GridView when no Data returned.
http://geekswithblogs.net/dotNETvinz/archive/2009/03/11/tiptrick-show-header-and-footer-of-gridview-when-no-data.aspx

Solution: Show Header/Footer of Gridview with Empty Data Source
http://forums.asp.net/t/960167.aspx
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 38825885
You should try setting CanUserAddRows to true
0
 
LVL 10

Accepted Solution

by:
Monica P earned 500 total points
ID: 38825913
Can use the "<EmptyDataTemplate>" Tag

<EmptyDataTemplate>
   <asp:Label runat="server" ID="lblNoRecord" Text="No Records Found."></asp:Label>

                 <asp:LinkButton runat="server" ID="lnk_Add_INV" Visible="true" Text="Add New informatio " OnClick="Add_Click"></asp:LinkButton>
               
</EmptyDataTemplate>

To access the controls in the emptydatatemplate refer http://forums.asp.net/p/1436652/3240106.aspx

EmptyDataTemplate example

http://shibashishdotnetocean.blogspot.com/2012/02/using-aspnet-gridview-emptydatatemplate.html
0
 

Author Comment

by:sarang8180
ID: 38854131
What is Dhaest...Where is the property called CanUserAddRows?I cannot find it
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 38862948
CanUserAddRows - my mistake: is for windows controls
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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