Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • karen 186 posts 461 karma points
    Feb 04, 2010 @ 03:10
    karen
    0

    Creating a custom dropdownlist

    I am trying to create a custom datatype for a dropdownlist with a specific list of values to choose from.

    The list long and may change and be re-ordered and using the UI  to create one based on dropdownlist  and then setting all the prevalues, it doesn't allow you to set the order or edit what is there.

    So I thought I could just extend that and add a bunch of values.  I thought I saw an example of that somewhere but now after looking the past 1/2 hour I cannot find it.  I was wonder if there is an example of this?

    I have been looking at this example but am not understanding what I need to do.

    Thanks,

    Karen

     

  • Tom Maton 387 posts 660 karma points
    Feb 04, 2010 @ 10:14
    Tom Maton
    0

    Hi Karen,

    What you need to do for this method is just create a normal user control within visual studio and upload to your site, i would suggest the user controls folder.

    Create a new datatype within hte UI and select "Umbraco user control wrapper" from the drop down and then point to the uploaded ascx file (user control) you just built and then you can select this for your document/media type.

    Tom

  • karen 186 posts 461 karma points
    Feb 04, 2010 @ 18:30
    karen
    0

    Ok, I have it figured out, the html page has the drop list and all the values I need, and here is the code I needed to put in the code behind

     

        public partial class BookingDropDownList : System.Web.UI.UserControl, umbraco.editorControls.userControlGrapper.IUsercontrolDataEditor {
            protected void Page_Load(object sender, EventArgs e) {

            }

            public object value {
                get {
                    return this.ddlBookingOptions.SelectedValue;
                }
                set {
                    this.ddlBookingOptions.SelectedValue = value.ToString();
                }
            }       
        }
Please Sign in or register to post replies

Write your reply to:

Draft