如何将字典绑定到DataGrid或DataGridView [英] How to Bind Dictionary into a DataGrid or DataGridView

查看:142
本文介绍了如何将字典绑定到DataGrid或DataGridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法绑定简单的字典< string,string>

我想在第一列中显示键字符串,在第二列中显示值


不能将字典绑定到DataGridView.

Not able to bind a simple dictionary<string,string>

i would like to show the key string in first column and value in second coloum


thanks

推荐答案

ou不能将字典绑定到DataGridView.您可能要考虑从字典中构建一个IList,然后将其绑定到DataGridView.
ou can''t bind a dictionary to a DataGridView. You might want to consider building an IList out of the dictionary and then bind it to the DataGridView.


这篇关于如何将字典绑定到DataGrid或DataGridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆