如果我有这样的清单:
列表
BindingList<BindingList<Message>> Messages = new BindingList<BindingList<Message>>();
Messages.Add(new BindingList<Message>() { new Message("hello", "userName", new DateTime(2008, 5, 1, 8, 30, 52)) });
Messages.Add(new BindingList<Message>() { new Message("This is a message", "mister obvious", new DateTime(2008, 5, 1, 8, 30, 52)) });
Messages.Add(new BindingList<Message>() { new Message("Hellow sappo", "pipo", new DateTime(2008, 5, 1, 8, 30, 52)) });
Messages.Add(new BindingList<Message>() { new Message("deathstar message", "darthvader", new DateTime(2008, 5, 1, 8, 30, 52)) });
消息对象
class Message {
string msg;
string Sender;
DateTime senddate;
public Message(string msg, string Sender, DateTime senddate)
{
this.msg = msg;
this.Sender = Sender;
this.senddate = senddate;
}
public string message {
get { return msg; }
}
public string sendInfo {
get { return Sender +" | " + senddate.ToString(); }
}
}
我可以将它绑定到DevExpress数据网格吗?我想用datagrid创建这样的东西:
我不知道该怎么做(如果可能的话)。到目前为止,我只做了像这样的数据网格: