0
我從CD或記錄當前設置這樣的數據:DATAFORMAT爲DataGridView的數據源
class Release //class containing all details of release
{
public string Artist; //Release Artist
public string Title; //Release Title
public string Released; //Released (Date)
public Image Image; //Image
private List<Track> trackList = new List<Track>(); //List containing tracks
public List<Track> TrackList
{
get
{
return trackList;
}
}
//CONSTRUCTOR
public Release()
{
//Initialize strings to empty strings
Artist = "";
Title = "";
Released = "";
Image = null;
}
class Track
{
public string Position;
public string Title;
public string TrackArtist;
public Track()
{
//Initialize strings
Position = "";
Title = "";
TrackArtist = "";
}
}
這工作得很好,因爲我不知道有多少軌道那裏,當我填充他們,所以我可以再補充是一個新的項目列表中找到每一個。
但是我不能解決如何將我的曲目列表放入DataGridView中,而無需手動逐個填充它。
什麼是更好的方式來構造數據?
在此先感謝。
工作過的感謝! – Dave 2009-11-30 22:25:37
太棒了!聽到那個消息很開心。你會選擇它作爲接受的答案嗎? – 2009-11-30 22:41:15