GridView ASP.NET 2.0 Question

D

dm1608

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
 
R

Ram

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top