Thursday, December 07, 2006

When using the GridView, you can specify an “EmptyDataTemplate” to display when there is no data specified in the DataSource. This is great, but the problem from my point of view is that the column headers are not displayed. I would like them to be displayed, even if there is no data.

In my search for the solution I found the following article which explains how to achieve this result by overriding CreateChildControls:

http://www.dotnetslackers.com/GridView/re-27953_Displaying_GridView_When_No_Data_Exists.aspx