我只能说.Find("boundField", true)
这是一个例子
PropertyDescriptor propertyA = TypeDescriptor.GetProperties(DataBinder.GetDataItem(control.NamingContainer)).Find("boundField", true);
PropertyDescriptor propertyB = TypeDescriptor.GetProperties(DataBinder.GetDataItem(control.NamingContainer)).Find("boundField", true);
两行代码都是相同的,当我调试时它们会返回null
但是当我尝试从它们中取出这样的值时,它们会给出不同的值(这是正确的),这怎么可能呢? ?
PropertyAFieldValue = this.GetValue(control.NamingContainer, this._PropertyAField, ref propertyA).ToString();
PropertyBFieldValue = this.GetValue(control.NamingContainer, this._PropertyBField, ref propertyB).ToString();
对于其他代码,请查看How can Property Descriptor gets values of two controls using same code line?