//Department Grid Bind #region [Department Grid Bind] private void GrdDepartmentBind() { try { objEWA.OrgId = orgId; DataSet ds = objBL.DepartmentGridBind_BL(objEWA); if (ds.Tables[0].Rows.Count == 0 || ds == null) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GrdDepartment.DataSource = ds; GrdDepartment.DataBind(); int columncount = GrdDepartment.Rows[0].Cells.Count; GrdDepartment.Rows[0].Cells.Clear(); GrdDepartment.Rows[0].Cells.Add(new TableCell()); GrdDepartment.Rows[0].Cells[0].ColumnSpan = columncount; GrdDepartment.Rows[0].Cells[0].Text = "No Records Found"; } else { GrdDepartment.DataSource = ds; GrdDepartment.DataBind(); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Page Indext Created #region GrdIndexChanged protected void GrdDepartment_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { GrdDepartment.PageIndex = e.NewPageIndex; objEWA.OrgId = orgId; GrdDepartment.DataSource = objBL.DepartmentGridBind_BL(objEWA); GrdDepartment.DataBind(); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }