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
Brock Allen - 17 Feb 2006 22:56 GMT
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.
>
[quoted text clipped - 5 lines]
>
> Thanks
Ram - 18 Feb 2006 09:35 GMT
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