protected void ApprovedGridView() { using (PTCLEntities db = new PTCLEntities()) { var MyApprovedComplaintData = db.AdminApprovedComplaint().ToList(); GVApprovedComplaint.DataSource = MyApprovedComplaintData; GVApprovedComplaint.DataBind(); GVApprovedComplaint.UseAccessibleHeader = true; if (GVApprovedComplaint.Rows.Count > 0) { GVApprovedComplaint.HeaderRow.TableSection = TableRowSection.TableHeader; } else { lblTableClosedMsg.Text = "No Record to Show"; } } }