0
我是新手,我試圖簡單地結合HashSet
爲DataGridView中的DataSource
,但仍然有GridView
綁定的HashSet到DataGridView的數據源C#
dataGridViewBookList.DataSource = null;
dataGridViewBookList.DataSource = bookContainer;
創建哈希集合
bookContainer = new HashSet<BookModel>();
dataGridViewBookList.DataSource = bookContainer;
BookModel類的任何項目
class BookModel
{
public string Name { get; set; }
public uint Year { get; set; }
public string Series { get; set; }
public string Pulbisher { get; set; }
public string Author { get; set; }
public string Language { get; set; }
public uint PagesCount { get; set; }
}
請幫忙綁定h灰設置爲GridView。對不起,我是C#的新手。
非常感謝。