Column span all columns when Gridview Data is empty

Posted on 2013-01-25
Last Modified: 2013-01-28
Hello Experts,

I was trying to show gridview Headers , when there is no data, but I cannot column span all columns and remove the rowstyle and show the text "No Data Present".

Sample gridview:

ID         NAME
--        ------------


Something like above.
Question by:ASPDEV
  • 2
  • 2
LVL 41

Expert Comment

ID: 38820693
With 4.0 you can set ShowHeaderWhenEmpty="True" and have EmptyDataTemplate to have your text.

Author Comment

ID: 38827257
Sorry, It was ASP.NET 3.5.
LVL 41

Accepted Solution

guru_sami earned 500 total points
ID: 38827602
Then there isn't an built-in way but weird workarounds.
Some of them listed here

Author Closing Comment

ID: 38828876

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
New to SOAP and need some direction 10 44
WKHTMLTOPDF - --disable-smart-shrinking not working 10 35
Resolve Dependency Issues 4 44
ASP.NET 5 Templates 2 65
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now