0

Is it possible to bind a List<object> to a ListView and use more than one property as display members?

The object contains in total 3 properties:

String name;
String email;
Int cost;

Please refrain from using for/foreach/while loops as I'm looking for a solution that utilizes databinding.


create a custom property with only getter and combine properties in the getter

4

3 回答 3

1

use a dataview ( with databinding if you are in WPF )

于 2013-02-27T16:35:54.167 回答
0

If you are using WinForms, instead of using ListView, you can use an ObjectListView, which I find is an easier way to hold classes in that type of control without all the casting problems.

However, if you are using a ListView you will have to suck it up and add in each item individually.

于 2013-02-27T16:41:07.617 回答
0

创建一个只有 getter 的自定义属性,并在 getter 中组合属性

于 2013-02-27T16:32:31.390 回答