我绑定了一个类到PropertyGrid控件上 但是我想在PropertyGrid控件上修改这个属性 他怎么直接把类的属性修改了。
就像我要修改这个 变成Chart 怎么同时把这个类的这个属性修改成Chart.NETPropertyGrid

解决方案 »

  1.   

     /// <summary>
        /// 扩展属性描述类
        /// </summary>
        [Serializable]
        [XmlRoot("BookMark")]
        public class BookMarkProperty
        {
            public BookMarkProperty()
            {
                _bookMarkType = BookMarkType.TextReplace;
                _dataOriginType = 0;
            }        public BookMarkProperty(string name, BookMarkType bookMarkType, string tag, string dataName, DataOriginType dataOriginType, bool allowPaging, string code)
            {
                _tagName = name;
                _bookMarkType = bookMarkType;
                _dataName = dataName;
                _dataOriginType = dataOriginType;
                _allowPaging = allowPaging;
                _contentCode = code;
                _tag = tag;
            }        //属性名称
            private string _tagName;
            [Category("设计"), Description("属性名称")]
            [XmlElement("Name")]
            public string TagName
            {
                get { return _tagName; }
                set { _tagName = value; }
            }        //属性标识
            private string _tag;
            [Category("设计"), Description("属性标识")]
            [XmlElement("Tag")]
            public string Tag
            {
                get { return _tag; }
                set { _tag = value; }
            }        
            private BookMarkType _bookMarkType;        /// <summary>
            /// 数据类型
            /// </summary>
            [Category("数据"), Description("数据类型")]
            [XmlElement("BookMarkType")]
            public BookMarkType BookMarkType
            {
                get { return _bookMarkType; }
                set { _bookMarkType = value; }
            }        //书签名:SQM
            private string _labelName;
            [Category("常规"), Description("书签名,唯一名称"),ReadOnly(true)]
            [XmlElement("LabelName")]
            public string LabelName
            {
                get { return _labelName; }
                set { _labelName = value; }
            }        //数据名称
            private string _dataName;
            [Category("数据"), Description("数据名称")]
            [XmlElement("DataName")]
            public string DataName
            {
                get { return _dataName; }
                set { _dataName = value; }
            }        //数据来源:描述数据是来自于参数、变量、还是表;
            private DataOriginType _dataOriginType;
            [Category("数据"), Description("数据来源")]
            [XmlElement("DataOrigin")]
            public DataOriginType DataOriginType
            {
                get { return _dataOriginType; }
                set { _dataOriginType = value; }
            }        //是否分页
            private bool _allowPaging;
            [Category("设计"), Description("是否分页")]
            [XmlElement("AllowPaging")]
            public bool AllowPaging
            {
                get { return _allowPaging; }
                set { _allowPaging = value; }
            }        //属性字段
            private string _contentCode;
            [Category("数据"), Description("属性字段")]
            [XmlElement("ContentCode")]
            public string ContentCode
            {
                get { return _contentCode; }
                set { _contentCode = value; }
            }
        }