怎么把字典集合数据绑定到DataGridView中

小丢丢 2012-03-27 12:17:56
使用DataGridView控件显示字典集合Dictionary中的数据

求解释,求求求 嘿嘿
...全文
507 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
a7926116 2012-11-10
  • 打赏
  • 举报
回复
???????你们想啥呢,DataGridView的DataSource怎么能是字典类型呢
threenewbee 2012-03-27
  • 打赏
  • 举报
回复
DataGridView.DataSource = dict;
  • 打赏
  • 举报
回复
++[Quote=引用 1 楼 caozhy 的回复:]

DataGridView.DataSource = dict;
[/Quote]
深海之蓝 2012-03-27
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 caozhy 的回复:]
DataGridView.DataSource = dict;
[/Quote]
+1
vinjent 2012-03-27
  • 打赏
  • 举报
回复
private Dictionary<string, double> dictionary = new Dictionary<string, double>();
private BindingSource bindingS = new BindingSource();

private void Form1_Load(object sender, EventArgs e)
{
dictionary.Add("A", 123);
dataGridView1.DataSource = bindingS;
bindingS.DataSource = dictionary;
}

110,539

社区成员

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

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

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