Home All Groups Group Topic Archive Search About
Author
12 May 2005 3:51 AM
Machi
I am very new to ASP.NET 2.0. I tried to use GridView control and its
built-in SqlDataSource object. Where there is data for a particular table
which i bind my GridView to, the GridView can show successfully. However,
when there is no record in my table which i bind my GridView to, the whole
GridView will not be displayed. May i know how to make my GridView just
displays the header text when there is no record in my table?Thanks.

Author
12 May 2005 3:43 PM
Brock Allen
There is a <EmptyDataTemplate> you can specify for when there are now rows
to be shown. I usually put something like "No Rows Returned" or somesuch.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I am very new to ASP.NET 2.0. I tried to use GridView control and its
> built-in SqlDataSource object. Where there is data for a particular
> table which i bind my GridView to, the GridView can show successfully.
> However, when there is no record in my table which i bind my GridView
> to, the whole GridView will not be displayed. May i know how to make
> my GridView just displays the header text when there is no record in
> my table?Thanks.
>