Access ControlDesigner Property
Hi Team Telerik,
I have implemented custom control with ControlDesigner. Below is the declaration of it
[ControlDesigner(typeof(FieldsWidgetDesigner)]
public partial class MyCustomControl : System.Web.UI.UserControl
//Added my code here.
It works beautifully. Now my question is:
Inside the ControlDesigner Class: FieldsWidgetDesigner I have a property.
I need to access this property inside my custom Class: MyCustomControl
Please let me know how this can be acheived.
Regards,
Siddesh Kapadi
Hello,
This should be done the other way round. All the properties that you want to have in your control, should be exposed in the control's class. Then, in the designer, you can set these properties, from the client-side script, by calling the this._propertyEditor.get_control() method that returns the control class with all of its properties and lets you set their values.
Here's an article that can explains in detail how to work with control designers:
http://www.sitefinity.com/blogs/joshmorales/posts/11-09-20/creating_advanced_sitefinity_4_widget_control_designers.aspx
Let me know if you need further help with this.