【问题标题】:ExpandableObjectConverter properties are not showing in propertyGrid c#ExpandableObjectConverter 属性未显示在 propertyGrid c# 中
【发布时间】:2015-11-23 16:22:24
【问题描述】:

我创建了具有 ExpandableObjectConverter 类型的基本类,它包含我需要在调用类中显示为可扩展的属性,以便在 propertyGrid 中显示,但它只在属性网格中显示类名,而没有它下面的属性

 [TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class SR1000
{

    [Description("Recieve Data Timeout")]
    public int Timeout { get; set; }

    [Description("Client IP Address")]
    [DisplayName("IP Address")]
    public string IpAddress { get; set; }

    [Description("Command and Data Port")]
    public int Port { get; set; }

    [Description("Bar Code Reader Postion")]
    public Point2D Poistion { get; set; }
 }


 [Serializable()]
[XmlRoot("BarCodeReader.BarCodeReader")]
public class BarCodeReader : ISystemDevice, IStationSpecificDevice
{

    [Category("SR1000")]
    public SR1000 SR1000 { get; set; }
}

知道我错过了什么

【问题讨论】:

    标签: c# propertygrid typeconverter


    【解决方案1】:

    我完全忘了创建属性对象的实例

     public BarCodeReader()
        {
            SR1000 = new SR1000();
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-12
      • 2017-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多