public static void SetDropDownTreeSelected(DropDownTree ddv, string selValue) { bool flag = false; for (int i = 0; i < ddv.Items.Count; i++) { DropDownTreeItem item = ddv.Items[i]; if (item.Value == selValue) { flag = true; } else if (!flag && (item.Items.Count > 0)) { for (int j = 0; j < item.Items.Count; j++) { if (item.Items[j].Value == selValue) { flag = true; } } } if (flag) { ddv.SelectedValue = selValue; return; } } }
private void ddt_stateBind() { if (base.Request.QueryString["Type"] == "-3") { com.jwsoft.pm.entpm.PageHelper.BindDropDownTree(this.ddt_state, 7, true, base.Request.QueryString["Type"]); return; } if (base.Request.QueryString["type"] == "-2") { string sqlString = "select * from XPM_Basic_CodeList where (TypeID=7) and (IsVisible=1)and(IsValid=1) and codeId In(-3,-2,16,11)"; DataTable dataTable = publicDbOpClass.DataTableQuary(sqlString); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { DropDownTreeItem dropDownTreeItem = new DropDownTreeItem(); dropDownTreeItem.Text = dataTable.Rows[i]["CodeName"].ToString(); dropDownTreeItem.Value = dataTable.Rows[i]["CodeID"].ToString(); this.ddt_state.Items.Add(dropDownTreeItem); } } } }