comboBoxPlanResult.DataSource =new BindingSource(o,null);
comboBoxPlanResult.DisplayMember ="Key";
comboBoxPlanResult.ValueMember ="Value";

DataGridView  类,ListBox等控件支持标准的   Windows   窗体数据绑定模型。这意味着数据源可以是实现下列接口之一的任何类型:   
IList   接口,包括一维数组,ArrayList也是。   
IListSource   接口,例如,DataTable   和   DataSet   类。   
IBindingList   接口,例如,BindingList   类。   
IBindingListView   接口,例如,BindingSource   类。   
如果把其它的东西当做数据源,就会出现上面的错误。

c# combobox 绑定报错的更多相关文章

  1. Vue2.0 Props双向绑定报错简易处理办法

    在写项目的时候遇到了一个报错问题,虽然功能是正常运行,chrome的提示是:[Vue warn]: Avoid mutating a prop directly since the value wil ...

  2. (复习)父子组件传值使用v-modal双向绑定,报错Avoid mutating a prop directly解决方案

    报错:Avoid mutating a prop directly since the value will be overwritten whenever the parent component. ...

  3. 实现combobox模糊查询的时候报错 InvalidArgument=“0”的值对于“index”无效

    因为要对combobox实现模糊查询,因为系统实现的匹配只能从左到右进行匹配,所以利用两个list来进行模糊匹配,主要代码如下: List<string> listOnit = new L ...

  4. 多次绑定DataGridView的DataSource会报错 NullReferenceExcepti

    最近做了一个winform的项目,数据绑定在datagridview中,datagridview中的数据需要删除,分页,更新等之类的操作,所以就涉及到了datagridview的重新绑定问题,而且这些 ...

  5. Winform知识汇总之多次绑定DataGridView的DataSource会报错 NullReferenceExcepti

    最近做了一个winform的项目,数据绑定在datagridview中,datagridview中的数据需要删除,分页,更新等之类的操作,所以就涉及到了datagridview的重新绑定问题,而且这些 ...

  6. [问题记录]cocos的lua绑定安装pyyaml报错

    描述:按照readme中的文档操作报错,提示python2.7没有安装,但是确实已经安装了,而且也设置环境变量成功了. 解决: 在D盘新建register.py的文件,内容如下: # # script ...

  7. 【spring cloud】spring cloud中启动eureka集群时候,发生端口已经绑定的报错The Tomcat connector configured to listen on port 8000 failed to start. The port may already be in use or the connector may be misconfigured.

    在分别设置 进行微服务eureka集群启动时候,执行命令行启动jar包时候,报错前面一个端口8000已经被使用,而我这里启动的配置文件中端口号是8001,怎么会导致端口冲突呢?? 但是报错我的端口冲突 ...

  8. Combobox绑定泛型字典时提示“复杂的 DataBinding 接受 IList 或 IListSource 作为数据源”的解决方法

    一般情况下我们会将 DataTable 或 DataView 绑定到 Combobox 控件上,这时候进行数据绑定是没有问题的,因为DataTable 和 DataView 都继承了 IList 接口 ...

  9. Windows 7上执行Cake 报错原因是Powershell 版本问题

    在Windows 7 SP1 电脑上执行Cake的的例子 http://cakebuild.net/docs/tutorials/getting-started ,运行./Build.ps1 报下面的 ...

随机推荐

  1. python标准库介绍——2 os.path模块详解

    == os.path 模块 == ``os.path`` 模块包含了各种处理长文件名(路径名)的函数. 先导入 (import) ``os`` 模块, 然后就可以以 ``os.path`` 访问该模块 ...

  2. django 连接mysql 数据库

    1.新建一个mysite项目:django-admin startproject mysite 2.进入项目目录,新建一个app : python manage.py startapp polls 3 ...

  3. OpenWrt加入iptables 支持过滤字符串

    须要在iptables命令选项中选择mod filter Network->Firewall->iptables->mod filter Kernel Modules->Net ...

  4. mybatis 一二事(2) - 动态代理

    db.properties 单独提取出来的数据库配置,方便以后维护管理 jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhos ...

  5. 简易C#动态加载dll(实现插件化)

    可以通过该方法来实现程序插件化. 假设A,B两个类,A类为宿主,B类为插件需要加载到A类中: class Program { public interface IHellow { void Hello ...

  6. transitionFromViewController方法的使用

    转自:http://blog.sina.com.cn/s/blog_7b9d64af0101c2vm.html 1.背景   iOS 5.0 以前 ,我们在一个视图控制器中会用addSubView方法 ...

  7. winform TreeView 节点选择

    public partial class Form1 : Form { public Form1() { InitializeComponent(); } string tag = "Tru ...

  8. python文件和目录操作方法大全

    一.python中对文件.文件夹操作时经常用到的os模块和shutil模块常用方法. 1.得到当前工作目录,即当前Python脚本工作的目录路径: os.getcwd()2.返回指定目录下的所有文件和 ...

  9. Hbase shell 常用命令(1)

    下面我们看看HBase Shell的一些基本操作命令,我列出了几个常用的HBase Shell命令,如下: 名称 命令表达式 创建表 create '表名称', '列名称1','列名称2','列名称N ...

  10. svn 使用笔记(一)

    检出: svn checkout http://***.***.***.*** path --username *** --password ***   更新: svn update path --f ...