c#:如何轻松显示字典?
我有一本字典,我想以某种形式显示。 做到这一点最简单的方法是什么?
我最好想展示一个可以使用 int 值进行排序的控件。 我尝试过 DataGridView 但没有任何显示,我一定做错了什么......
代码:
mDataGridView.DataSource = mWordCount;
/*Where mWordCount is the Dictionary<string, int> but nothing shows up. (It's a forms-app, not a web-app)*/
I have a dictionary that I want to show in a form.
What's the easiest way to do this ?
Preferrably I'd like to show a control where I can sort using the int-value.
I've tried a DataGridView but nothing shows up, I must be doing something wrong...
Code:
mDataGridView.DataSource = mWordCount;
/*Where mWordCount is the Dictionary<string, int> but nothing shows up. (It's a forms-app, not a web-app)*/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
mWordCount.ToList()
看看会发生什么。说明位于此处:
Try
mWordCount.ToList()
and see what happens.Explanation is here: