// Bind Employee List #region [Bind Employee List] private void BindEmployeeList() { try { objEWA.OrgId = Convert.ToInt32(Session["OrgId"].ToString()); objEWA.Action = "SelectEmployee"; objEWA.PayGrpID = Convert.ToInt32(DDL_PayGroup.SelectedValue); DataSet ds = objBL.BL_BindEmployeeList(objEWA); if (ds.Tables[0].Rows.Count == 0 || ds == null) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GrdAssinedPayGroup.DataSource = ds.Tables[0]; GrdAssinedPayGroup.DataBind(); int columncount = GrdAssinedPayGroup.Rows[0].Cells.Count; GrdAssinedPayGroup.Rows[0].Cells.Clear(); GrdAssinedPayGroup.Rows[0].Cells.Add(new TableCell()); GrdAssinedPayGroup.Rows[0].Cells[0].ColumnSpan = columncount; GrdAssinedPayGroup.Rows[0].Cells[0].Text = "No Records Found"; } else { GrdAssinedPayGroup.DataSource = ds.Tables[0]; GrdAssinedPayGroup.DataBind(); } if (ds.Tables[1].Rows.Count == 0 || ds == null) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GrdNotAssined.DataSource = ds.Tables[0]; GrdNotAssined.DataBind(); int columncount = GrdNotAssined.Rows[0].Cells.Count; GrdNotAssined.Rows[0].Cells.Clear(); GrdNotAssined.Rows[0].Cells.Add(new TableCell()); GrdNotAssined.Rows[0].Cells[0].ColumnSpan = columncount; GrdNotAssined.Rows[0].Cells[0].Text = "No Records Found"; } else { GrdNotAssined.DataSource = ds.Tables[1]; GrdNotAssined.DataBind(); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Show Empty Grid #region [Show Empty Grid] private void ShowEmptyGridView(DataSet ds) { try { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GrdAssinedPayGroup.DataSource = ds; GrdAssinedPayGroup.DataBind(); int columncount = GrdAssinedPayGroup.Rows[0].Cells.Count; GrdAssinedPayGroup.Rows[0].Cells.Clear(); GrdAssinedPayGroup.Rows[0].Cells.Add(new TableCell()); GrdAssinedPayGroup.Rows[0].Cells[0].ColumnSpan = columncount; GrdAssinedPayGroup.Rows[0].Cells[0].Text = "No Records Found"; } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }