【发布时间】:2012-03-14 16:05:22
【问题描述】:
我正在使用 BrightIdeasSoftware 的 objectListView 组件,我想展示一个我创建的列表。所以我有两列:标题,艺术家。 接下来,我写了一个歌曲类:
class Song
{
public Song()
{
}
public Song(string title, string artist)
{
this.Title = title;
this.Artist = artist;
}
public string Title
{
get { return title; }
set { title = value; }
}
private string title;
public string Artist
{
get { return artist; }
set { artist = value; }
}
private string artist;
}
并创建了一个列表:
List<Song> songs = new List<Song>();
Song example = new Song("My Immortal", "Evanescence");
songs.Add(example);
最后,我调用了 SetObjects:
objectListView1.SetObjects(songs);
但是...问题是该列表以空列表的形式呈现给我! (我的意思是,没有字符串是在运行时写入的......)
谁能帮我找出原因...?
【问题讨论】:
标签: c# .net list object objectlistview