protected void DepartmentDropDownList_SelectedIndexChanged(object sender, EventArgs e) { DivisionDropDownList.DataSource = dal.GetDivision(DepartmentDropDownList.SelectedValue); DivisionDropDownList.DataBind(); UpdateGrid(); }
private void LoadOrgDivisionDropDownList() { List <DivisionInfo> aDivisionInfos = _divisionInfoManager.GetAllDivision() ?? new List <DivisionInfo>(); DivisionDropDownList.DataSource = aDivisionInfos; DivisionDropDownList.DataValueField = "Id"; DivisionDropDownList.DataTextField = "DivisionName"; DivisionDropDownList.DataBind(); DivisionDropDownList.Items.Insert(0, new ListItem("Select One", "")); }
private void UserDivision() { string U = Context.User.Identity.Name; string UU = U.Substring(U.IndexOf(@"\") + 1); int dv, dp, b; dal.UserDivision(UU, out dv, out dp, out b); if (dv != 0) { BlockDropDownList.DataSource = dal.GetBlock(); BlockDropDownList.DataBind(); BlockDropDownList.SelectedValue = b.ToString(); DepartmentDropDownList.DataSource = dal.GetDepartment(BlockDropDownList.SelectedValue); DepartmentDropDownList.DataBind(); DepartmentDropDownList.SelectedValue = dp.ToString(); DivisionDropDownList.DataSource = dal.GetDivision(DepartmentDropDownList.SelectedValue); DivisionDropDownList.DataBind(); DivisionDropDownList.SelectedValue = dv.ToString(); } else { BlockDropDownList.DataSource = dal.GetBlock(); BlockDropDownList.DataBind(); DepartmentDropDownList.DataSource = dal.GetDepartment(BlockDropDownList.SelectedValue); DepartmentDropDownList.DataBind(); DivisionDropDownList.DataSource = dal.GetDivision(DepartmentDropDownList.SelectedValue); DivisionDropDownList.DataBind(); } }