> What is a good way to check for a gridview or a datasource not having any rows?
> If my gridview does not have any rows i want to display a message saying the
[quoted text clipped - 11 lines]
> KES
> --
No i did not that is why i asked the question. Thank you for this answer it
is very much appreciated.

Signature
(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)
kes
> On Aug 29, 11:00 pm, WebBuilder451
> <WebBuilder...@discussions.microsoft.com> wrote:
[quoted text clipped - 17 lines]
> to show such message?
> http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.empt
ydatatext.aspx
Alexey Smirnov - 30 Aug 2007 13:57 GMT
On Aug 30, 2:48 pm, WebBuilder451
<WebBuilder...@discussions.microsoft.com> wrote:
> No i did not that is why i asked the question. Thank you for this answer it
> is very much appreciated.
okay, and if you still want to use code-behind you can use Rows.Count
property
...
GridView1.DataBind();
if (GridView1.Rows.Count == 0) {
Label1.Text = "No records found";
Label1.Visible = true;
}
WebBuilder451 - 30 Aug 2007 14:52 GMT
i was adding header rows on row data bound or row created and this was always
throwing the count off.
I did not see that property for empty text. Again This was an obvious, big
still a big help!

Signature
(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)
kes
> On Aug 30, 2:48 pm, WebBuilder451
> <WebBuilder...@discussions.microsoft.com> wrote:
[quoted text clipped - 10 lines]
> Label1.Visible = true;
> }