這是我的問題。我有一個類遊戲,我想將一些成員綁定到數據網格,而不是整個對象。什麼是更好的方法來做到這一點?創建另一個對象來保存信息,或創建一個數據表?如何將一個對象的成員綁定到數據網格
public class Game
{
public string Name {get;set; }
public string Description {get;set;}
public string FullPath {get;set;}
}
List<Game> Games = new Games { game1, game2, game3 };
dataGrid1.ItemsSource = Game; // I don't want to do this it will bind entire object.
不知道你是否可以有實例,或者鏈接到一個很好的示例。 – retide 2011-05-20 14:30:11
謝謝,我發現它。 http://www.wpftutorial.net/DataGrid.html – retide 2011-05-20 14:38:42