We can add text as 'No record found' in Gridview,when there is no data with the help of EmptyDataText property.
<asp:GridView ID="grid_view_employee_details" runat="server" AllowPaging="true" AutoGenerateColumns="false"
EmptyDataText = "No record(s) found"
OnRowDataBound="grid_view_employee_details_RowDataBound" OnSelectedIndexChanged ="grid_view_employee_details_SelectedIndexChanged">
When gridview binds with dataset object or any other object,and that object is null or empty,then "No record(s) found" text will be displayed in GridView.
Asked In: Many Interviews |