Click here to Skip to main content
15,996,252 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Is there a way to show the column headers of a GridView control even if
there is no data?
Posted

If you are using .Net framework 4.0, set ShowHeaderWhenEmpty[^] property of the GridView to True. That's all required to show the header even if the datasource is empty.

For other versions, checkout this blog post - A more elegant solution to display GridView header and footer when the data source is empty[^]

Hope this helps!
 
Share this answer
 
s...you can use template field in your gridview so that u can view your headers of grid even it is empty
 
Share this answer
 
Comments
Ankur\m/ 9-Jan-12 0:23am    
s? What does that mean?
Member 8459400 9-Jan-12 0:29am    
no..i have linkbuttons present in the header of the gridview...so if i use the template field i m getting a error..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900