1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Display Dropdownlist for public Properties for a user control

Display Dropdownlist for public Properties for a user control

2 posts, 0 answered
  1. rmoynihan
    rmoynihan avatar
    18 posts
    Registered:
    28 May 2007
    16 Jul 2008
    Link to this post
    Hi,

    I want to add a custom module to Sitefinity so that when this user control is dragged onto a page and when the user clicks on edit it will launch a properties windows which will display a dropdown to choose from instead a textbox which is the normal behavior for a public property on a user control.

    Also the values in this dropdown list needs to be dynamic.

    Thanks,

    Ronan


  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    17 Jul 2008
    Link to this post
    Hi rmoynihan,

    Unfortunately, the described scenario is impossible. To achieve a greater control over the way properties are edited, you have two options:

    1. Create a designer for User Control.
    2. Create a type editor for your property.

    Create a designer for User Control

    The designer is basically a completely customizable user interface for editing properties of a control. The pros of this approach are that you are not limited in any way how are you going to let your users edit properties (drop down list, grid view, tree view...), while cons are that it is a bit time consuming.

    More info on designers for User Control as well as the sample designer you can find here:
    http://blogs.sitefinity.com/Ivan/Post/08-04-23/how_to_create_a_control_designer_for_user_controls.aspx

    Create a type editor for your property

    Type editors can be thought of as designers for only one single property. When you implement a type editor, Sitefinity will display a little "Select" button next to the property text box (you may have seen this already in some of the controls).

    More information on implementing a type editor you can find here:
    http://blogs.sitefinity.com/Ivan/Post/07-05-24/working_with_complex_properties_in_custom_public_controls_webtypeeditor_.aspx

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.


    All the best,
    Ivan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered