日期:2014-05-17  浏览次数:20855 次

有谁熟悉dev中的propertyGridControl控件吗?
我不知道该怎么写类,把数据显示出来,希望高手们能帮我一下,另外我是才入门的,真的很纳闷,花了两天时间还是没有搞定,网上也查不到相关资料。谢谢了

------解决方案--------------------
装了之后,开始菜单里有demo,代码里找它吧
------解决方案--------------------
两种方法。一写个属性类; 二手动填充。
 /// <summary>
/// 通用属性构造函数
/// </summary>
public class CustomProperty
{
#region 内部参数
private string _ID;
private string _Name;
private string _Discription;
private int? _StrategyLevel; 
#endregion

#region 外部属性
/// <summary>
/// ID
/// </summary>
[CategoryAttribute("对象"), DescriptionAttribute("当前选中对象的编号"), DisplayName("编号")]
[Browsable(true),ReadOnly(true)]
public string ID
{
get { return _ID; }
set { _ID = value; }
}

/// <summary>
/// 名称
/// </summary>
[CategoryAttribute("对象"), DescriptionAttribute("当前选中对象的名称"), DisplayName("名称")]
[Browsable(true), ReadOnly(true)]
public string Name
{
get { return _Name; }
set { _Name = value; }
}

/// <summary>
/// 描述
/// </summary>
[CategoryAttribute("对象"), DescriptionAttribute("当前选中对象的名称"), DisplayName("描述")]
[Browsable(true), ReadOnly(true)]
public string Disctription
{
get { return _Discription; }
set { _Discription = value; }
}
/// <summary>
/// 策略等级
/// </summary>
[CategoryAttribute("对象"), DescriptionAttribute("当前选中对象的策略等级"), DisplayName("策略等级")]
[Browsable(true)]
public int? StrategyLevel
{
get { return _StrategyLevel; }
set { _StrategyLevel = value; }

#endregion

/// <summary>
/// 通用属性构造函数
/// </summary>
public CustomProperty()
:this(string.Empty,string.Empty,string.Empty,null)
{

}
/// <summary>
/// 通用属性构造函数
/// </summary>
/// <param name="id">编号</param>
/// <param name="name">名称</param>
/// <param name="discription">描述</param>
/// <param name="strategyLevel">策略等级</param>
public CustomProperty(string id, string name, string discription, int? strategyLevel)
{
_ID = id;
_Name = name;
_Discription = discription;
_StrategyLevel = strategyLevel;
}

}