Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView ASP.NET 2.0 Question

Reply
Thread Tools

GridView ASP.NET 2.0 Question

 
 
dm1608
Guest
Posts: n/a
 
      02-17-2006
Hi, I'm using a GridView and an ObjectDataSource to display data.

How can I display a "No records found" message if there are no query
results?

Currently, I'm getting a blank page since the GridView has nothing to
display.

Thanks



 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      02-17-2006
The GridView has an EmptyDataTemplate for when there are no rows.

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


> Hi, I'm using a GridView and an ObjectDataSource to display data.
>
> How can I display a "No records found" message if there are no query
> results?
>
> Currently, I'm getting a blank page since the GridView has nothing to
> display.
>
> Thanks
>



 
Reply With Quote
 
 
 
 
Ram
Guest
Posts: n/a
 
      02-18-2006
Hi,

Use the "EmptyDataText property" of the grid view.

Ex:
<asp:GridView ID="GridView1" EmptyDataText="No timesheets entered."
EmptyDataRowStyle-CssClass ="EmptyText" runat="server"
AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1">

Thanks and Regards,
S.Ramalingam

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question: Gridview within Gridview issue Cirene ASP .Net 1 11-04-2007 05:38 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
GridView in a GridView Carlos Albert ASP .Net 2 12-06-2005 12:42 PM
GridView in a GridView Nalaka ASP .Net 6 12-05-2005 05:48 PM
Gridview with combobox whose data is dependent on field in gridview wallermj@hotmail.com ASP .Net 3 11-21-2005 05:34 PM



Advertisments