DataGribView 发生以下异常: System.ArgumentException:DataGridViewComboBoxCell值无效

OopsJeff 2012-08-06 05:07:15
DataGribView 发生以下异常: System.ArgumentException:DataGridViewComboBoxCell值无效.
这个怎么搞啊?

我是这样做的 table 1 (ip, name, item) item里面对应的值是 table2 (id,unit) 里面的unit
怎么样在datagridview 里显示出 ip, name, unit

table1
1, 'abc', 2
2, 'fds', 3
3, 'fdasf',2
4,'fda',1


table2
1,'斤'
2,'吨'
3,'千克'


怎么样在datagridview 里显示出
1,'abc','吨'
2,'fds','千克'




...全文
580 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
OopsJeff 2012-08-08
  • 打赏
  • 举报
回复
无匹配的值.默认值可以设置吗? 怎么设置
机器人 2012-08-06
  • 打赏
  • 举报
回复
这是很基本的 DataGridViewComboboxColumn 的使用问题。查看下msdn,有示例。

comboboxColumn.DataSource = RetrieveAlternativeTitles();
comboboxColumn.ValueMember = "表示名称的列名";
comboboxColumn.DisplayMember = "值的列名";


txworld 2012-08-06
  • 打赏
  • 举报
回复
不知是我不懂,还是你写得很乱。看不明白写什么。
OopsJeff 2012-08-06
  • 打赏
  • 举报
回复
up 我自己来..... 让大家看到

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧