How to override/extend FormsControlDesigner?

Posted by Community Admin on 03-Aug-2018 21:34

How to override/extend FormsControlDesigner?

All Replies

Posted by Community Admin on 17-Mar-2011 00:00

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

 

Posted by Community Admin on 23-Mar-2011 00:00
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
This thread is closed