这是我的问题。我有一个类游戏,我想将一些成员绑定到数据网格,而不是整个对象。什么是更好的方法来做到这一点?创建另一个对象来保存信息,或创建一个数据表?如何将一个对象的成员绑定到数据网格
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