You tried to change the DisplayType property while the control contains an object.
Remove the object, then set the DisplayType property.