我正在尝试使用propertygrid进行可配置/可编辑的对象。 除了对象内部的对象,这一切都很顺利。编辑PropertyGrid中的对象内的对象的属性
我有一个名为“ContactInformation”的对象/类。在那个对象里面我有一个名为“函数”的对象。
这是部分的外观:
[Browsable(false)]
public Correspondence Correspondence
{
get;
set;
}
public int CorrespondenceStatus
{
get { return this.Correspondence.Status; }
set { this.Correspondence.Status = CorrespondenceStatus; }
}
public string CorrespondenceComment
{
get { return this.Correspondence.Comment; }
set { this.Correspondence.Comment = CorrespondenceComment; }
}
public DateTime CorrespondenceDate
{
get { return this.Correspondence.LastSend; }
set { this.Correspondence.LastSend = CorrespondenceDate; }
}
这样我可以显示属性的对象内的对象/变量,PropertyGrid中。
无论如何,当我现在编辑的值,然后按回车,或者点击其他地方,而不是保持它的价值我刚才输入,它变回..
任何人有一个想法,为什么这种情况正在发生?或者,也许更好的主意,以显示在propertygrid中的对象的属性?
也许PropertyGrid中的一个简单的刷新将解决这个问题。 '改变数据后的'propertyGrid.refresh()'。 – Samidjo 2011-06-16 08:07:33
不,没有工作.. – 2011-06-16 08:56:25
@MichielMagendans,你是否成功地在扩展器中编辑变量? – 2013-04-11 09:41:01