Geeks With Blogs

Tangible Thoughts SharePoint, MOSS? and all the other questions

"Such and Such a grid should not be blank when there is no data, it should show the column headers with no rows."

How many times have you heard that?

Yeah, I've seen it as bugs in the change request system!! Seems like a simple enough request, but trying to deliver it sends you straight into the land of GridView hacking. Oh why was such a simple feature not incorporated into the GridView. Microsoft are you listening.

Instead you have to jump hoops.

Here are some of those hoops that help you solve the problem

http://forums.asp.net/p/960167/1892125.aspx#1892125

http://mattberseth.com/blog/2007/07/how_to_show_header_and_footer.html

Infact let google guide you through all the numerous posts on this topic.

 

Cross-posted from tariqayad.com

Posted on Thursday, September 6, 2007 2:44 PM | Back to top


Comments on this post: Showing GridView Headers When There Is No Data

# re: Showing GridView Headers When There Is No Data
Requesting Gravatar...
Use the Empty data template, no it does not show the headers, but at least something is shown which is what my goal was

<emptydatatemplate>

No Data Found.

</emptydatatemplate>

Left by Ken Wilson on Nov 19, 2008 1:35 PM

# re: Showing GridView Headers When There Is No Data
Requesting Gravatar...
show gridview header and footer when empty data source
please check this post i think it will be useful as solution for this issue http://ledomoon.blogspot.com/2009/04/show-grid-view-header-and-footer-when.html
Left by Waleed Mohamed on Oct 09, 2009 4:31 AM

# re: Showing GridView Headers When There Is No Data
Requesting Gravatar...
What if i want to show the entire gridview for the admin to be able to enter data when there's no data to display.
Left by Felix on Oct 10, 2012 8:39 PM

Your comment:
 (will show your gravatar)


Copyright © Tariq | Powered by: GeeksWithBlogs.net