是否有可能一个列表绑定到的WinForms一个ListView? [英] Is it possible to bind a List to a ListView in WinForms?

查看:83
本文介绍了是否有可能一个列表绑定到的WinForms一个ListView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想绑定一个ListView到列表与LT;串> 。我使用这个代码:

I'd like to bind a ListView to a List<string>. I'm using this code:

somelistview.DataBindings.Add ("Items", someclass, "SomeList");



我得到这个异​​常:无法绑定属性项,因为它是只读 - 只。

我不知道,如果项目属性为只读我应该怎么绑定?

I don't know how I should bind if the Items property is readonly?

推荐答案

ListView控件类不支持设计时绑定。另一种是在呈现这个项目

The ListView class does not support design time binding. An alternative is presented in this project.

这篇关于是否有可能一个列表绑定到的WinForms一个ListView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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