ここの指示に従って、このクラス インスタンスを Xceed PropertyGrid に表示しようとしています。
PG.SelectedObject = new Order()
{
ShipAddress = "Luisenstr. 48",
ShipCountry = "Germany",
ShipName = "Toms Spezialitaten",
ShipPostalCode = "44087",
chronology = new OrderChronology()
{
OrderDate = new DateTime(1996, 7, 5),
ShippedDate = new DateTime(1996, 8, 16)
}
};
私がやろうとしていることに類似した動作のXceedの例は、これを言いyou must decorate your property with the ExpandableObject attribute.
、示しています:
public class Person
{
[Category("Information")]
[DisplayName("First Name")]
[Description("This property uses a TextBox as the default editor.")]
public string FirstName { get; set; }
[Category("Conections")]
[Description("This property is a complex property and has no default editor.")]
[ExpandableObject]
public Person Spouse { get; set; }
}
クラスで同じことをしようとすると (以下を参照)、コンパイラ エラーが発生します。それは好きではなく[ExpandableObject]
、私がそうかもしれないことをほのめかしていますmissing a using directive or assembly reference
。私ですか?
public class Order
{
public string ShipAddress { get; set; }
public string ShipCountry { get; set; }
public String ShipName { get; set; }
public String ShipPostalCode { get; set; }
[ExpandableObject]
public OrderChronology chronology;
}
public class OrderChronology
{
public DateTime OrderDate { get; set; }
public DateTime ShippedDate { get; set; }
}