protected void DdlCountry_SelectedIndexChanged(object sender, EventArgs e) { DataTable ObjStateTable = MyJobPortalModel.State.GetStateRecords("countryId=" + DdlCountry.SelectedValue + " and status='Active'"); DdlState.DataSource = ObjStateTable; DdlState.DataBind(); DdlState.Items.Insert(0, new ListItem("--Select State--", "--Select--")); }
private void BindApplyState() { var dataSource = EnumAttribute.GetDict <ApplyInvoiceState>(); dataSource.Remove((int)ApplyInvoiceState.WaitAudit); DdlState.DataSource = dataSource; DdlState.DataBind(); DdlState.SelectedValue = string.Format("{0}", (int)ApplyInvoiceState.All); }
public void BindState(string cid) { DdlState.DataTextField = "name"; DdlState.DataValueField = "id"; DataView dv = new DataView(ds.Tables["State"]); dv.RowFilter = "cid = " + cid; DdlState.DataSource = dv.ToTable(); DdlState.DataBind(); BindCity(DdlState.SelectedValue); }
protected void DdlCountry_SelectedIndexChanged(object sender, EventArgs e) { if (DdlCountry.SelectedIndex != 0) { DataTable ObjStateTable = MyJobPortalModel.State.GetStateRecords("status='Active' and CountryId=" + DdlCountry.SelectedValue); DdlState.DataSource = ObjStateTable; DdlState.DataBind(); DdlState.Items.Insert(0, new ListItem("--Select--", "--Select--")); } else { DdlState.Items.Clear(); DdlState.Items.Add(new ListItem("--Select--", "--Select--")); } }
private void PopulateStateDropDownList() { DdlState.DataSource = objBll.GetJob("spGetState", null); DdlState.DataBind(); ListItem liCState = new ListItem("Select State", "-1"); DdlState.Items.Insert(0, liCState); ListItem liDistrict = new ListItem("Select District", "-1"); DdlDistrict.Items.Insert(0, liDistrict); ListItem liMunicipality = new ListItem("Select Municipality", "-1"); DdlMunicipality.Items.Insert(0, liMunicipality); DdlMunicipality.Enabled = false; DdlDistrict.Enabled = false; }