?
Solved

Does .NET 2.0 offer a DataGrid equivalent to the GridView "EmptyDataText"

Posted on 2006-11-15
8
Medium Priority
?
806 Views
Last Modified: 2010-08-05
I would like to add this feature to my DataGrid and I'm unsure if 2.0 now offers this capability:

EmptyDataText="There are no data records to display."

Also, is there a good website that has all of the options available for DataGrid, i.e. like
AutoGenerateColumns, AlternatingItemStyle-BackColor, OnItemDataBound, EmptyDataText, etc.?
0
Comment
Question by:robjay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 9

Assisted Solution

by:kraffay
kraffay earned 500 total points
ID: 17949058
Here's the MSDN page for the data grid:

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref16/html/T_System_Web_UI_WebControls_DataGrid_Members.htm

As for the empty data, I usually but a hidden label on the page, and if there are no results, I set the text to something like "no records found" and make it visible.
0
 
LVL 28

Expert Comment

by:strickdd
ID: 17949084
The GridView control has an Empty Date Template:

<EmptyDataTemplate>
   Enter text here.
</EmptyDataTemplate>
0
 
LVL 11

Accepted Solution

by:
ethoths earned 500 total points
ID: 17949092
Not that I'm aware of. You would have to code this in the code behind, say in the onprerender event of your page.

I don't know of a good reference sit eother than the msdn site...
    http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagrid.aspx

Of course the intellisense in VS2005 is rather excellent.

This is a good how to site
    http://aspnet.4guysfromrolla.com/articles/041702-1.aspx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:ethoths
ID: 17949099
I stand corrected by strickdd. Thanks, I was looking for a property but I guess it makes sence that its a template.

0
 
LVL 28

Expert Comment

by:strickdd
ID: 17950092
excuse me, but I do think I gave the answer that was needed... ethoths even pointed that out. Why didn't I get any points?
0
 
LVL 9

Expert Comment

by:kraffay
ID: 17950480
The GridView has a template, but the DataGrid does not.
0
 
LVL 28

Expert Comment

by:strickdd
ID: 17950513
Oh, okay. I misread the question.
0
 

Author Comment

by:robjay
ID: 17950580
Appreciate your enthusiasm strickdd.  I think ethoths also misunderstood the applicability of your reply too hence his reply to you.  Thanks all for your help.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

752 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