protected void ddlSearchCategory_SelectedIndexChanged(object sender, EventArgs e) { if (ddlSearchCategory.SelectedItem.Text != "Select") { // To bind first ddl value list.. DataSet ds = new DataSet(); LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP(); ddlSearchCategory1.DataSource = ds.Tables[2]; ddlSearchCategory1.DataTextField = "Lpcategoryname"; ddlSearchCategory1.DataValueField = "Lpcategoryid"; ddlSearchCategory1.DataBind(); ddlSearchCategory1.Items.Insert(0, "Select"); } else { ddlSearchCategory1.Items.Clear(); ddlSearchCategory1.Items.Add("Select"); // fetch value of the grid details.... DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Fetch Grid Page Size Details... DataTable pg = new DataTable(); GeneralBAL pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][0].ToString() != string.Empty) { grdLP.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); } #endregion // Bind the banner of the image. DataSet ds = new DataSet(); GeneralDAL lp = new GeneralDAL(); ds = lp.FetchBanner(); if (ds.Tables[2].Rows.Count != 0) { imgBanner.ImageUrl = ds.Tables[2].Rows[0][1].ToString(); } //End Bind the banner of the image. // fetch value of the grid details.... DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.DataBind(); if (Request.QueryString["LPId"] != null) { int rowno = 0; for (int i = 0; ds1.Tables[0].Rows.Count > i; i++) { if (ds1.Tables[0].Rows[i]["LPId"].ToString() == Request.QueryString["LPId"].ToString()) { rowno = i; } } FetchGridDetails(Request.QueryString["LPId"].ToString()); grdLP.PageIndex = rowno / grdLP.PageSize; int SelectedRowIndex = rowno - (grdLP.PageSize * grdLP.PageIndex); grdLP.DataBind(); grdLP.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; }//other load festival here..... else { if (ds1.Tables[0].Rows.Count != 0) { FetchGridDetails(ds1.Tables[0].Rows[0][0].ToString()); grdLP.Rows[0].BackColor = System.Drawing.Color.LightGray; } //End fetch value of the grid details.... } } }
private void FetchDetails() { LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP(); gridviewLP.DataSource = ds.Tables[0]; gridviewLP.DataBind(); }
protected void gridPageChanging(object sender, GridViewPageEventArgs e) { if (ddlSearchCategory.SelectedItem.Text == "Select" & ddlSearchCategory1.SelectedItem.Text == "Select") { DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.PageIndex = e.NewPageIndex; grdLP.DataBind(); } else { DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchLPGridDetails(ddlSearchCategory1.SelectedItem.Text); grdLP.DataSource = ds; grdLP.PageIndex = e.NewPageIndex; grdLP.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Fetch Grid Page Size Details... DataTable pg = new DataTable(); GeneralBAL pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][0].ToString() != string.Empty) grdLP.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); #endregion // Bind the banner of the image. DataSet ds = new DataSet(); GeneralDAL lp = new GeneralDAL(); ds = lp.FetchBanner(); if (ds.Tables[2].Rows.Count != 0) imgBanner.ImageUrl = ds.Tables[2].Rows[0][1].ToString(); //End Bind the banner of the image. // fetch value of the grid details.... DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.DataBind(); if (Request.QueryString["LPId"] != null) { int rowno = 0; for (int i = 0; ds1.Tables[0].Rows.Count > i; i++) { if (ds1.Tables[0].Rows[i]["LPId"].ToString() == Request.QueryString["LPId"].ToString()) rowno = i; } FetchGridDetails(Request.QueryString["LPId"].ToString()); grdLP.PageIndex = rowno / grdLP.PageSize; int SelectedRowIndex = rowno - (grdLP.PageSize * grdLP.PageIndex); grdLP.DataBind(); grdLP.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; }//other load festival here..... else { if (ds1.Tables[0].Rows.Count != 0) { FetchGridDetails(ds1.Tables[0].Rows[0][0].ToString()); grdLP.Rows[0].BackColor = System.Drawing.Color.LightGray; } //End fetch value of the grid details.... } } }