I found this code in one of the project developed by an Ex-Employee for custom gridview with custom controls which works fine but I am not sure what exactly it is doing,
GetValue(control.NamingContainer, this._PropertyAField, ref propertyA)
ProperyA is given as a reference therefor everything that happens to propertyA inside that method will update propertyA that was defined above.
using
PropertyDescriptor propertyA = null;
instead of
PropertyDescriptor propertyA = TypeDescriptor.GetProperties(DataBinder.GetDataItem(control.NamingContainer)).Find("boundField", true);
will still work.
Further Reading
ref method parameter keyword
In view of your most recent edit:
How can Property Descriptor gets values of two controls using same code line
It can't. For some reason, the former employee wanted both propertyA
and propertyB
to be the same or there is a typo, and this is in actual fact a bug of some sort.