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