+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Edit fields for a custom control

Edit fields for a custom control

7 posts, 0 answered
  1. Aysha
    Aysha avatar
    4 posts
    Registered:
    04 Feb 2011
    04 Feb 2011
    Link to this post
    Hi

    I have been given a sitefinity websit to update some controls on it. This is first time I am working on sitefinity and could not get much info from development guide regarding my problem.  The developer working earlier has developed a control instead of a module to provide a  form for course registration. Now this control has been included in the website and it works fine.

    Now they need a facility to allow the editor of the website to be able to enter the heading of the Registration control. I understand that If this control has been developed as a Module, I could have added properties for the "edit " panel and it would have been easy sailing for all of us, but this is not a module and is a User control , how do you suggest I provide HTMLfields for  "Edit Panel" for this registraion control.

    When I click on the "edit " link for this control under sitefinity, it shows me general control properties like

    Behaviour panela and Control ID panel .. I want to add HTMLField box under these panels.

    I hope I am clear enough regarding what I want to achieve.

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Feb 2011
    Link to this post
    Hello Aysha,

    You have to create a control designer for your control.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Aysha
    Aysha avatar
    4 posts
    Registered:
    04 Feb 2011
    04 Feb 2011
    Link to this post
    Hi

    I did as you pointed me to and I think the version I am using does not support LayoutTemplatePath property for Telerik.Framework.Web.Design.ControlDesigner class.

    I am getting following compilation erros:

    Error   6   'CustomRegistrationDesigner.LayoutTemplatePath': no suitable method found to override  
    Error   13   'CustomRegistrationDesigner.InitializeControls(System.Web.UI.Control)': no suitable method found to override  
    Error   26   'Telerik.Framework.Web.Design.ControlDesigner' does not contain a definition for 'Container'  

    I checked the definition of ControlDesignerBase and ControlDesigner and they do not really have any LayoutTemplatePath property.

    We are using sitefinity version 3.2

    Many Thanks


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Feb 2011
    Link to this post
    Hi Aysha,

    You should upgrade your project to use the designers. The version you use is about 3 years old.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Aysha
    Aysha avatar
    4 posts
    Registered:
    04 Feb 2011
    04 Feb 2011
    Link to this post
    Thanks for such an instant reply.

    Since I am a beginner to use Sitefinity, Can you please point me in the right direction ?

    I mean how do I upgrade my project to use control designers. Will this update break my existing project?

    Are there any other changes which will affect my current version of website?

    Is there an easy way to handle this requirement other than upgrading the sitefinity version? I am a bit hesitant to upgrade the site as It may open a total new can of worms.

    I hope you understand what I mean.
  6. Aysha
    Aysha avatar
    4 posts
    Registered:
    04 Feb 2011
    04 Feb 2011
    Link to this post
    One more thing I would like to mention is that we are using .Net 2.0 only.
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Feb 2011
    Link to this post
    Hello Aysha,

    Ok, you could inherit from ControlDesigner class and implement a template for the control.

    sample

    ublic ITemplate ItemTemplate
            {
                get
                {
                    if (this.itemTemplate == null)
                        this.itemTemplate = ControlUtils.GetTemplate(this.ItemTemplatePath, ControlDesignerTemplate, this.AssemblyInfo, this.LocalizationAssemblyInfo, this.GetType(), this.providerName);
                    return this.itemTemplate;
                }
                set
                {
                    this.itemTemplate = value;
                }
            }

    You need to implement the template in the designer.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered