x First time here? Check out the FAQ
  • Avatar246posts314karma

    Using Umbraco Date Time Picker in ASCX file

    TaoistTotty started this topic April 24, 2011 @ 06:40, Go directly to the topic solution

    I know this is probably a simple question but is there anyway of using the Umbraco Date Time Picker in an ascx control?

    Many thanks


  • Avatar401posts541karma
    Comment with ID: 74881
    Eran Meir posted this reply April 24, 2011 @ 07:38

  • Avatar246posts314karma
    Comment with ID: 74882
    TaoistTotty posted this reply April 24, 2011 @ 07:44

    Many thanks for the suggestion Eran, I will give this a go.



  • Richard Soeteman posted this reply April 26, 2011 @ 09:16


    You can use the default Umbraco control.Add a reference to EditorControls dll and create an usercontrol

    Declare the following namespace

    using umbraco.uicontrols.DatePicker;

    override the OnInit method to add the control

     protected override void OnInit(EventArgs e)

    DateTimePicker dateValuePicker = new DateTimePicker();



    Hope this helps you,



  • Avatar246posts314karma
    Comment with ID: 75525
    TaoistTotty posted this reply May 1, 2011 @ 09:46

    Many thanks Richard this worked.



  • Avatar796posts609karma
    Comment with ID: 128032
    Greg posted this reply October 8, 2012 @ 03:23

    Hey Richard... do you know if this approach can be used to create a custom control for a custom data type (i want to add a date picker to a custom control with a couple of other options)?  Any suggestions of the best way to achieve this?

  • Avatar2693posts6781karma
    Comment with ID: 128035
    Richard Soeteman posted this reply October 8, 2012 @ 07:23

    Hi Greg,

    Yes works also, exactly the same as you use it in a User Control. Just override the oninit method.

    Hope that helps,


  • Avatar796posts609karma
    Comment with ID: 128092
    Greg posted this reply October 8, 2012 @ 06:01

    You're right i got it working Richard... however I need the source code as I need to make a control with a date picker as well as some other fields, and they need to be able to interact with each other.  Think I'm going to outsource this one as I dont have time to figure it out myself right now :(


    THanks for the info..

  • Avatar547posts999karma
    Comment with ID: 128124
    Nigel Wilson posted this reply October 9, 2012 @ 05:10

    Hi there

    Sorry to reactivate an old post but is someone able to expand on Richards' post.

    The bit I am missing is how, after adding the code detailed, do you get a datepicker appearing on the page within your user control.

    As background - I am wanting to add a custom user control as a dashboard item with 2 date pickers (date from, date to).




Please login or Sign up To post replies