日期:2014-05-19  浏览次数:20729 次

Propertygrid控件的疑问,对返回object类型的属性为只读??
public   class   Class1
{
private   object   _Test;
public   object   Test
{
get{return   this._Test;}
set{this._Test   =   value;}
}
}

Class1   c   =   new   Class1();
this.propertyGrid1.SelectedObject   =   c;

在propertygrid   上该Test   属性为只读,如何把他改为可写?



------解决方案--------------------
找找propertygrid 上的设置。

我用的propertygrid 都是可写的
------解决方案--------------------
object 当然是只读的...因为没有指定 Editor...

你需要给该属性指定一个 UITypeEditor 类型的编辑器...