Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can i display message "no data exsist" while fetching data from table using sql connection in case no information exsist in database related to specific id using gridview?
Posted
Updated 24-Nov-11 17:11pm
v2

You can use EmptyDataTemplate
XML
<EmptyDataTemplate>
<div>
No Data Available
</div>
</EmptyDataTemplate>

Ref: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.emptydatatemplate.aspx[^]
 
Share this answer
 
Add emptydatatext attribute on your gridview.

SQL
<asp:GridView ID="gvRedemptions" runat="server" AllowPaging="True" PageSize="50"
                CellPadding="4" EmptyDataText="No record found." ForeColor="#333333" AutoGenerateColumns="false"
                OnPageIndexChanging="gvRedemptions_PageIndexChanging" OnSelectedIndexChanged="gvRedemptions_SelectedIndexChanged"
                Width="960px" AllowSorting="True" onsorting="gvRedemptions_Sorting">


Regards,
Eduard
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900