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

DatePicker showPopup()

2 Answers 135 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Franco De Simone
Top achievements
Rank 1
Franco De Simone asked on 21 Oct 2008, 08:39 AM
Hi,
using the DatePicker, I wanted to show the calendar clicking on its Dateinput. This is the cs code I used:
ForwardCalendar.DateInput.Attributes.Add("onclick"string.Format("$find('{0}').showPopup();", ForwardCalendar.ClientID)); 
ForwardCalendar.DateInput.Attributes.Add("onfocus"string.Format("$find('{0}').showPopup();", ForwardCalendar.ClientID)); 
ForwardCalendar.DateInput.Attributes.Add("onblur"string.Format("$find('{0}').hidePopup();", ForwardCalendar.ClientID)); 
 

In this way the calendar shows correctly, both when I click on the dateinput and when focusing it. The problem is that selecting a date on the calendar does nothing. No date is written on the dateinput.
When I click on the popup button, instead, it works perfectly.
Any idea?
Thanks.


2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 Oct 2008, 09:49 AM
Hello Franco,

Please check our online demo illustrating this functionality.
DatePicker Customization

Greetings,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Khanh
Top achievements
Rank 1
answered on 05 Jun 2009, 03:21 PM
Franco,

I had the same problem.  The onblur is causing the selecting problem when you tab and click in the dateinput.

The fix:
Remove
ForwardCalendar.DateInput.Attributes.Add("onblur", string.Format("$find('{0}').hidePopup();", ForwardCalendar.ClientID));  
and add onfocus attributes to the control before and after the calendar to hidepopup.

Hope this helps,
Khanh
Tags
Calendar
Asked by
Franco De Simone
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Khanh
Top achievements
Rank 1
Share this question
or