How to override/extend FormsControlDesigner?
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
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
>