locked
Custom Control Error: Cannot Create Object of Type Panel From Its String Representation. RRS feed

  • Question

  • User-1761619084 posted

    I have created a custom control and added a property of type panel to it. In the designer this property shows up as a drop down list with all the panels in the page. When I select a panel, the control disappears with a render error stating that it cannot create object of type panel from its string representation. I can however set the property from code behind by giving the property a reference to the panel, but not from designer. 

    Friday, May 9, 2008 10:12 AM

Answers

  • User-734952044 posted

     Hi,

    You must create a TypeConverter  that can convert a string containing a control ID to the corresponding Panel instance.

    Then you must register this TypeConverter to your property of type Panel.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 9, 2008 11:02 AM

All replies

  • User-734952044 posted

     Hi,

    You must create a TypeConverter  that can convert a string containing a control ID to the corresponding Panel instance.

    Then you must register this TypeConverter to your property of type Panel.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 9, 2008 11:02 AM
  • User-1761619084 posted

    Thank-you, that worked.

    Monday, May 12, 2008 10:32 AM