Creating the multi view designer

The control designer that you create in this section is a multi view designer. For more information about creating multi view control designers, see Multi view control designers.

To define the multi view designer and add the designer view that you created in this section, perform the following:

  1. In the context menu of the Designer folder, click Add » New Item...

  2. In the left pane, select Visual C# Items » Code.

  3. Click Class and in the Name input field, enter DatePickerFieldDesigner.

  4. Open the file in Visual Studio and add the following namespaces:

    using Telerik.Sitefinity.Web.UI;
    using Telerik.Sitefinity.Web.UI.ControlDesign;
  5. Change the class definition to:

    public class DatePickerFieldDesigner : ContentViewDesignerBase
    {
    }
  6. To specify the designer view in the multi view control designer paste the following code in DatePickerFieldDesigner.cs:

    protected override void AddViews(Dictionary<string, ControlDesignerView> views)
    {
        var myView = new DatePickerDesignerView();
        views.Add("myview", myView);
    }
  7. Implement the required methods by pasting the following code:

    protected override string ScriptDescriptorTypeName
    {
        get
        {
            return typeof(ContentViewDesignerBase).FullName;
        }
    }
     
    protected override void InitializeControls(GenericContainer container)
    {
        this.PropertyEditor.HideAdvancedMode = true;
        base.InitializeControls(container);
    }
     
    protected override Type ResourcesAssemblyInfo
    {
        get
        {
            return typeof(Telerik.Sitefinity.Resources.Reference);
        }
    }
  8. Save the file.

In the AddViews method you add the views for the date picker control designer to the views argument it receives.

After creating the multi view control designer, you must assign it to the date picker control. For more information, see Assigning the designer to the date picker control.

Next steps

+1-888-365-2779
sales@sitefinity.com

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK