Geeks With Blogs
AzamSharp Some day I will know everything. I hope that day never comes.

GridView control has the EmptyDataTemplate which can be used to display any controls in case where GridView does not render anything. Since Header and Footer are not displayed when GridView does not contain anything thats why EmptyDataTemplate is a perfect place to display input controls so user can input data and populate the GridView control.

 

powered by IMHO 1.3

Posted on Thursday, February 16, 2006 8:16 PM | Back to top


Comments on this post: Display something when there is GridView is empty

# re: Display something when there is GridView is empty
Requesting Gravatar...
So how do you access that template after the first data record is saved and now the Grid has a record in it? The EmptyDataTemplate will not be displayed again correct?
Left by Greg on Feb 17, 2006 9:52 AM

# re: Display something when there is GridView is empty
Requesting Gravatar...
Yes, it wont be displayed. Thats the whole point of it :)
Left by azamsharp on Feb 17, 2006 9:59 AM

# re: Display something when there is GridView is empty
Requesting Gravatar...
Absolute Godsend!!

Well done matey!
Left by Jon J on Mar 14, 2006 5:33 AM

# re: Display something when there is GridView is empty
Requesting Gravatar...
how do you reference input controls in the emptydatatemplate? (i.e. FindControl...)
Left by jecker01 on Aug 10, 2006 11:27 AM

Your comment:
 (will show your gravatar)


Copyright © Mohammad Azam | Powered by: GeeksWithBlogs.net