Pages

GridView Control No Data Message

The GridView control supports the EmptyDataTemplate property for you to specify the markup that should be used when the control is bound to an empty data source. Don't forget to write the Databind code in the code behind page. if the binded object [DataSet or DataTable or ICollection] is empty, then this empty template will be displayed.

<asp:GridView ...>
...
<EmptyDataTemplate>
<table style="border:solid 1px black"><tr><td>
<b>GridView Control No Data Message</b>
No data to display. </td>
</tr></table>
</EmptyDataTemplate>
</asp:GridView>

No comments:

Post a Comment