Hi,
I get child properties of an object with this code,
PropertyDescriptorCollection childProperties = TypeDescriptor.GetProperties(theObject)[childNode.Name].GetChildProperties();
think that "theObject" variable is a TextBox and I try to set TextBox.Font.Bold = true;
I use this code for main properties and it works when I customize for main properties. But when I access the child properties,
I get an error which is "Object reference not set to an instance of an object.".
foreach (PropertyDescriptor childProperty in childProperties)
{
foreach (XmlAttribute attribute in attributes)
{
if (childProperty.Name == attribute.Name)
{
if (!childProperty.IsReadOnly)
{
object convertedPropertyValue = ConverterHelper.ConvertValueForProperty(attribute.Value, childProperty);
childProperty.SetValue(theObject, convertedPropertyValue); //exception throw here
break;
}
}
}
}