This is a migrated thread and some comments may be shown as answers.

Datetimepicker with calendar icon

1 Answer 822 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Alcatraz
Top achievements
Rank 1
Alcatraz asked on 29 Jul 2010, 11:58 AM

Hi,

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.

Thanks
Krishnan N

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 30 Jul 2010, 10:08 AM
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,
Nikolay
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
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Alcatraz
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or