+1-888-365-2779
Try Now
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
    Registered:
    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:

    http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/forms-module-notification.aspx#0

    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
    Registered:
    25 Nov 2016
    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">
       <designers:ContentSelector
           ID="selector"
           runat="server"
           ItemType="Telerik.Sitefinity.Forms.Model.FormDescription"
           ItemsFilter="Visible == true AND Status == Live"
           TitleText="Choose News"
           BindOnLoad="false"
           AllowMultipleSelection="false"
           WorkMode="List"
           SearchBoxInnerText=""
           SearchBoxTitleText="<%$Resources:Labels, NarrowByTyping %>"
           ServiceUrl="~/Sitefinity/Services/Forms/FormsService.svc"
           ListModeClientTemplate="<strong class='sfItemTitle'>{{Title}}</strong>">
       </designers:ContentSelector>
    </div>

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


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