Datetimepicker with calendar icon

2 posts, 0 answers
  1. Alcatraz
    Alcatraz avatar
    15 posts
    Member since:
    Mar 2010

    Posted 29 Jul 2010 Link to this post


    I have a requirement where I need to have my Datepicker designed (not the colors or theme) as attached.  Over here, unlike the normal datetimepicker which shows like a dropdown control, we need to have a textbox and a image and on click of this image the calendar should be popped down.  All the RadDatetimepicker's features are still valid but the calendar should pop up only on click of this image and it should hide the calendar when we click outside.

    Kindly let me know if I can achieve this functionality using the existing RadDatetimepicker control.

    Krishnan N

  2. Nikolay
    Nikolay avatar
    1805 posts

    Posted 30 Jul 2010 Link to this post

    Hi Alcatraz,

    Thank you for the question.

    Generally, you can find its answer in the support ticket that you have opened about the same topic. However, I am posting the solution here in case other customers are interested in the desired look and feel:
    // setting backcolors to transparent 
    this.radDateTimePicker1.BackColor = Color.Transparent; 
    ((FillPrimitive)this.radDateTimePicker1.DateTimePickerElement.Children[0]).BackColor = Color.Transparent; 
    // hiding the real border 
    ((BorderPrimitive)this.radDateTimePicker1.DateTimePickerElement.Children[2]).Visibility = Telerik.WinControls.ElementVisibility.Hidden; 
    this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Fill.GradientStyle = Telerik.WinControls.GradientStyles.Solid; 
    // setting position and color of the 'border' 
    this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Fill.BackColor = Color.Black; 
    this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Margin = new Padding(0, 0, 10, 0); 
    this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Padding = new Padding(1); 
    // modifying the arrow button 
    RadDateTimePickerArrowButtonElement button = (RadDateTimePickerArrowButtonElement)this.radDateTimePicker1.DateTimePickerElement.Children[1].Children[1]; 
    ((ImagePrimitive)button.Children[4]).Image = WindowsFormsApplication15.Properties.Resources.PlusSign; 
    button.Border.Visibility = Telerik.WinControls.ElementVisibility.Hidden; 
    button.Fill.Visibility = Telerik.WinControls.ElementVisibility.Hidden;

    I hope this helps.

    Sincerely yours,
    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
Back to Top