How to Display ASP.NET GridView Header and Footer When No Data is Pres(dotnetspidor.blogspot.com)
submitted by
sangam100(357) 3 years, 2 months ago
The default behaviour of asp.net gridview is that it hides both Gridview header and footer when no data is present. You can note the absence of data (that is not a single row is available) by
putting text in EmptyDataTemplate of asp.net gridview.
---- other templates-----No data is present.<\EmptyDataTemplate>
<\asp:GridView>
But still you might want to show header and footer. What can we do? There exists a cheat! Just add an empty row to the datasource and bind your gridview to this datasource. Here goes the code.
|category: ASP.NET
|Views: 299
tags:
ASP.NET another
Everyones tags:
Your Tags: