More in this section

Forums / General Discussions / How to override/extend FormsControlDesigner?

How to override/extend FormsControlDesigner?

2 posts, 0 answered
  1. Dan
    Dan avatar
    11 posts
    17 Sep 2012
    17 Mar 2011
    Link to this post

    I successfully created a custom control that extends the FormsControl, and am able to retrieve the submitted values using the example in this post:

    However, now I am trying to add public properties to my custom control, and would like them to appear in the control designer so the values can be set when the user adds the custom form control to the page.  What's the easiest way to accomplish that?

    I managed to create a custom control designer that extends FormsControlDesigner, but I have no idea what the template (.ascx) needs to contain, and can't figure out how to reuse the existing template either.

    All I want is to have the existing FormsControlDesigner contain an "Advanced" button that allows users to set the public properties in my control. 

    Thanks, DanO


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    23 Mar 2011
    Link to this post
    Hello Dan,

    You need to create a custom control designer that inherits from Telerik.Sitefinity.Modules.Forms.Web.UI.Designers. FormsControlDesigner

    and override LayoutTemplateName where you set the template below

    <%@ Register Assembly="Telerik.Sitefinity" TagPrefix="designers" Namespace="Telerik.Sitefinity.Web.UI.ControlDesign" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI"
        TagPrefix="sitefinity" %>
    <div id="selectorTag" style="display: none;" class="sfFlatDialogSelector">
           ItemsFilter="Visible == true AND Status == Live"
           TitleText="Choose News"
           SearchBoxTitleText="<%$Resources:Labels, NarrowByTyping %>"
           ListModeClientTemplate="<strong class='sfItemTitle'>{{Title}}</strong>">

    There is a css class in the default template that hides advanced button.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
2 posts, 0 answered