//Item Unit #region [Item Unit Grid Bind] private void GrdUnitBind() { try { objEWA.OrgId = Convert.ToInt32(Session["OrgId"]); DataSet ds = objBL.UnitGridBind_BL(objEWA); if (ds.Tables[0].Rows.Count == 0 || ds == null) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); GrdUnit.DataSource = ds; GrdUnit.DataBind(); int columncount = GrdUnit.Rows[0].Cells.Count; GrdUnit.Rows[0].Cells.Clear(); GrdUnit.Rows[0].Cells.Add(new TableCell()); GrdUnit.Rows[0].Cells[0].ColumnSpan = columncount; GrdUnit.Rows[0].Cells[0].Text = "No Records Found"; } else { GrdUnit.DataSource = ds; GrdUnit.DataBind(); } } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }
//Grid Index Changed #region GrdIndexChanged protected void GrdUnit_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { GrdUnit.PageIndex = e.NewPageIndex; GrdUnit.DataSource = objBL.UnitGridBind_BL(objEWA); GrdUnit.DataBind(); } catch (Exception exp) { GeneralErr(exp.Message.ToString()); } }