Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

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

How to show button and columns in GridView when there are no rows in it.Because i cannot see any data.
0
sarang8180
Asked:
sarang8180
  • 3
1 Solution
 
DhaestCommented:
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
 
DhaestCommented:
You should try setting CanUserAddRows to true
0
 
Monica PSoftware DeveloperCommented:
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
 
sarang8180Author Commented:
What is Dhaest...Where is the property called CanUserAddRows?I cannot find it
0
 
DhaestCommented:
CanUserAddRows - my mistake: is for windows controls
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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