Create a custom widget with a simple widget designer

The backbone of the designer is a custom widget. It wires up the template and the client component and allows you to assign the designer to the targeted widget in the code. The targeted widget is the widget, which you want to apply the simple designer to.

To create the class for the designer, perform the following.
  1. Add a new class to the project of the targeted widget.
    For example, if the widget is named SimpleWidget, create a class named SimpleWidgetDesigner.cs
  2. Add a reference to the Telerik.Sitefinity assembly.
    Perform the following:
    1. In the context menu of References, click Add Reference...
    2. Click Browse tab and navigate to folder C:\Program Files (x86)\Telerik\Sitefinity CMS\Libraries.
    3. Select the assembly and click OK.
  3. Add a reference to the System.Web.Extensions assembly.
    Perform the following:
    1. In the context menu of References, click Add Reference...
    2. Click the .NET tab, select the assembly, and click OK.
  4. Add statement using Telerik.Sitefinity.Web.UI.ControlDesign; to the SimpleWidgetDesigner class.
  5. Make the SimpleWidgetDesigner class to inherit the ControlDesignerBase class.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?