protected void grdstoreReqDelivery_RowDataBound(object sender, GridViewRowEventArgs e) { try { StoreBLL unitBll = new StoreBLL(); if (e.Row.RowType == DataControlRowType.DataRow) { var row = unitBll.GetStorByOcode(((SessionUser)Session["SessionUser"]).OCode.ToString()); //Find the DropDownList in the Row DropDownList ddlStoreList = (e.Row.FindControl("ddlStoreList") as DropDownList); ddlStoreList.DataSource = row; ddlStoreList.DataTextField = "StoreName"; ddlStoreList.DataValueField = "Store_Code"; ddlStoreList.DataBind(); ddlStoreList.Items.Insert(0, new ListItem("---Select---", "0")); var result = iChallanBll.GetListProgram(); DropDownList ddlStyle = (e.Row.FindControl("ddlStyle") as DropDownList); ddlStyle.DataSource = result; ddlStyle.DataValueField = "ProgramID"; ddlStyle.DataTextField = "ProgramName"; ddlStyle.DataBind(); ddlStyle.Items.Insert(0, new ListItem("-Select Program-", "0")); } } catch (Exception) { throw; } }
public void FillStore() { try { //string projectCode = ddlProject.SelectedValue.ToString(); var row = aStoreBll.GetStorByOcode(((SessionUser)Session["SessionUser"]).OCode); if (row.Count > 0) { ddlStoreName.DataSource = row.ToList(); ddlStoreName.DataTextField = "StoreName"; ddlStoreName.DataValueField = "Store_Code"; ddlStoreName.DataBind(); } } catch { } }
private void GetAllStore() { try { var result = aStoreBll.GetStorByOcode(((SessionUser)Session["SessionUser"]).OCode); if (result.Count > 0) { ddlStore.DataSource = result.ToList(); ddlStore.DataTextField = "StoreName"; ddlStore.DataValueField = "Store_Code"; ddlStore.DataBind(); ddlStore.Items.Insert(0, new ListItem("---Select Store---", "0")); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('" + ex.Message + "')", true); } }