网上查了这样的代码 虽然是可以用。但是会点击多次会出现”“ dropdownList不能选多个值的问题“

   private void initdroplistitemlirun(string c_Business)
{
if (this.Dplirun.Items.FindByText(c_Business) != null)
{
for (int i = ; i < this.Dplirun.Items.Count; i++)
{
this.Dplirun.Items[i].Selected = false;
if (this.Dplirun.Items[i].Text == c_Business)
{
Dpcompany.SelectedIndex = -;
this.Dplirun.Items[i].Selected = true;
break;
}
}
}
}
private void initdroplistitem(string c_Business)
{
if (this.Dpchengben.Items.FindByText(c_Business) != null)
{
for (int i = ; i < this.Dpchengben.Items.Count; i++)
{
this.Dpchengben.Items[i].Selected = false;
if (this.Dpchengben.Items[i].Text == c_Business)
{
Dpcompany.SelectedIndex = -;
this.Dpchengben.Items[i].Selected = true;
break;
}
}
}
}

最后发现 其实 用一句话就可以 那就是

  this.Dpchengben.SelectedIndex = this.Dpchengben.Items.IndexOf(this.Dpchengben.Items.FindByText(YTmodel.goaltype.Trim()));

最新文章

  1. SVG:linearGradient渐变在直线上失效的问题解决方案
  2. js_apply与call
  3. C语言:链表实现的一个实例
  4. 看懂理解 keyboard中 , navigation的设置: 切换工作区和移动窗口到不同的工作区.
  5. Centos6版本升级
  6. ExchangeServeice获取在线outlook邮箱中的未读邮件
  7. Java应用调优指南之-工具篇
  8. HDU 5750 Dertouzos 简单数学
  9. pywinauto简单介绍
  10. asp.net word内容读取到页面
  11. ThinkPHP - 每个操作都检测用户是否登录
  12. 建立、配置和使用Activity——启动其他Activity并返回结果
  13. Centos7 修改硬件时间和系统时间
  14. 随心测试_软测基础_004&lt;测试人员工作职责&gt;
  15. 【easy】572. Subtree of Another Tree
  16. Linux服务器之间进行文件目录映射/挂载(总结)
  17. truffle init 从零开始创建简单DApp项目
  18. jquery计算时间差(天、时、分、秒)并使用定时器实时获取
  19. python---ORM之SQLAlchemy(3)外键与relationship的关系
  20. AlertDialog 无法去掉自带的白边

热门文章

  1. UVALive 3668 A Funny Stone Game
  2. ssh使两台机器建立连接
  3. u-boot启动第二阶段以及界面命令分析
  4. final修饰的变量是引用不能改变还是引用的对象不能改变
  5. hive中行转换成列以及hive相关知识
  6. Codeforces 821C Okabe and Boxes(模拟)
  7. xpath简单应用
  8. 四、ansible主机组定义
  9. Button Bashing(搜索)
  10. 小甲鱼C++笔记(上)1-24