Try Now
More in this section

Forums / Developing with Sitefinity / Custom Control Designer

Custom Control Designer

2 posts, 0 answered
  1. Jason Hedges
    Jason Hedges avatar
    22 posts
    16 Jul 2009
    16 Aug 2010
    Link to this post
    I'm building a custom control for Sitefinity that needs a control property set through a drop-down list that is populated from a database table. My understanding is that a Control Designer is the best way to accomplish this.

    I've found several posts/articles on creating Control Designers but they do not all show the same syntax. Can you point me to the best one to follow?

    My current implementation is based on http://www.sitefinitywatch.com/blog/09-02-20/Making_Control_Editing_User-Friendly_with_Sitefinity_Control_Designers.aspx but my drop down list doesn't keep it's value by the time it gets to the OnSaving method.

    Any help is appreciated!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    25 Oct 2016
    17 Aug 2010
    Link to this post
    Hello Jason Hedges,

    In the ControlDesigner you should have RadComboBox control. In the control that uses your control designer you should have a property where you have to persists selected value.

    here is a sample code

    public override void OnSaving()
           ((ControlWithCustomDesigner)DesignedControl).Index = combo.SelectedValue;
           ((ControlWithCustomDesigner)DesignedControl).RadEditiorDialogValue = TextBoxFromTemplate.Text;


    public string RadEditiorDialogValue
            object obj = this.ViewState["RadEditiorDialogValue"];
            if (obj != null)
                return (string)obj;
            return "test";
            this.ViewState["RadEditiorDialogValue"] = value;

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered