PropertyDescriptor GetProperty (Control controlContainer, string fieldName)
{
if (fieldName == ThisExpression)
return null;
IDataItemContainer dic = (IDataItemContainer) controlContainer;
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (dic.DataItem);
PropertyDescriptor prop = properties != null ? properties [fieldName] : null;
if (prop == null)
throw new InvalidOperationException ("Property '" + fieldName + "' not found in object of type " + dic.DataItem.GetType());
return prop;
}