zoukankan      html  css  js  c++  java
  • Winform Comobox 绑定 Dictionary数据源

    使用BindingSource进行间接绑定

        Dictionary<string ,string> dic=new Dictionary<string,string>();
                BindingSource bs = new BindingSource();     //声明BindingSource
                
                dic.Add("GROUP_NAME","工序名称");
                dic.Add("TEST_ITEM_NAME", "测试项目名称");
                dic.Add("PERSON_MODIFY", "修改人");

                bs.DataSource = dic;        //绑定Dictionary

                this.cbb_ChooseItem.DataSource = bs;    //绑定BindingSource
                this.cbb_ChooseItem.ValueMember = "Key";
                this.cbb_ChooseItem.DisplayMember = "Value";

    使用:

    string chooseItem = this.cbb_ChooseItem.SelectedValue.ToString();

  • 相关阅读:
    微信消息类型和事件类型
    lnmp环境搭建脚本
    laravel框架踩过的坑
    vue结构详解
    PHP消息队列实现及应用
    laravel 运行错误
    笔记分享
    cf730e
    cf 730i
    cf 731f
  • 原文地址:https://www.cnblogs.com/hanje/p/10184719.html
Copyright © 2011-2022 走看看