protected void PendingGridView() { using (PTCLEntities db = new PTCLEntities()) { var PendingComplaintsData = db.ActiveC().ToList(); GVPendingComplaint.DataSource = PendingComplaintsData; GVPendingComplaint.DataBind(); GVPendingComplaint.UseAccessibleHeader = true; if (GVPendingComplaint.Rows.Count > 0) { GVPendingComplaint.HeaderRow.TableSection = TableRowSection.TableHeader; } else { lblTablePendingMsg.Text = "No Record to Show"; } } }