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

Forums / Developing with Sitefinity / Adding a drop down to the properties of a control

Adding a drop down to the properties of a control

3 posts, 0 answered
  1. David
    David  avatar
    78 posts
    Registered:
    29 Dec 2008
    23 Sep 2009
    Link to this post

    I created a intra-site module that allows the site editor to enter Promotions on the backend. 

     

    I am trying to determine a way (quick way) to create dropdown on the front end control that allows the site editor to select which promotion to display when the control is drop on the page.

     

    I discover the enum will automatically create the drop down in a control.  However how do I load enum at load time?  Could someone point me to a blog post or tutorial that will guide me?

     

    Thanks,

    David

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    24 Sep 2009
    Link to this post
    Hi David ,

    I suggest that you should use RadComboBox or DropDownList bound to your promotions list. Enum are useful when you want to manage control properties from Sitefinity's Control Designer.

    Sample code:

    protected void Page_Load(object sender, EventArgs e) 
     if (!Page.IsPostBack) 
     { 
     
       BindCombo(RadComboBox1); 
     } 
    private void BindCombo(RadComboBox combo) 
     string[] promoList= { "promo1""promo2""promo3" }; 
     combo.DataSource = promoList; 
     combo.DataBind(); 

    I hope this helps.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. David
    David  avatar
    78 posts
    Registered:
    29 Dec 2008
    24 Sep 2009
    Link to this post
    Ivan,
       I got it up and working.  I ended up using the WebEditor with radio buttons approach that I found on Gabe site.  The module and the front end controls are working very well. 

    Thanks,
    David
Register for webinar
3 posts, 0 answered