| Author: Vijay Kumar Naidu 02 Aug 2007 | Member Level: Gold | Rating: Points: 2 |
Dear Vijay,
You can very well do this! All you have to do is to set one of the property in GridView called "EmptyDataText = << Your message if no records available >>".
I believe this answer will help you. Enjoy!!
-Vijay Kumar Naidu.
|
| Author: Balaraju Veeragoni 02 Aug 2007 | Member Level: Silver | Rating: Points: 2 |
Hi,just look at this <table Width="100%"> <tr> <td colspan="2"> <asp:Label id="lblError" ForeColor="red" EnableViewState="false" Runat="Server" /> </td> </tr> <tr> <td colspan="2"> <asp:GridView id="grdListEmp" runat=server/> </td> </tr> </table> the abvoe code is for placing oneerror Label and GridView
in the page: Page_Load() { If(!Page.IsPostBack) { if(ds.table[0].rows.count>0) { GridView.DataSource=ds.table[0]; GridView.DataBind(); } else { lblError.text="No Records are found"; } } }
|