We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DateTimePickerAdv tab enter

I am trying to use a DateTimePickerAdv to get the following behavior: 1) When the user tabs into the DateTimePickerAdv (gives it focus), I want the calendar''s popup window to open. I was able to do this by overriding the OnGotFocus method and using: PopupWindow.ShowPopup (Calendar.Location); This works fine, except that now when you click on the control (not the drop down arrow, but any other part of the control) the popup window flashes open and then immediately closed. Ideally, it would be nice if clicking on the control had the normal behavior and it was just the tab that opened it (also having the drop down arrow still open the calendar). But if I could get the tab-enter behavior working and clicking on the control also popped up the calendar it might be acceptable. 2) If the user has focus on the DateTimePickerAdv – where they can use the arrow keys to change the date, is there a specific key that will open the calendar? Hitting the space bar will de-select the checkbox. It would be nice that a user doing just keyboard input on a form could tab into the calendar (forgetting the first behavior I suggested for a second) and hit a specific key to open the calendar. I know I could likely just override the OnKeyDown method and handle it that way, but I wondered if there was already a key that did this before I go that route. Thanks, Jonathan Quail

3 Replies

AR Anupama Roy Syncfusion Team February 20, 2006 02:22 PM UTC

Hi Jonathan, Sorry for the delay in response. Presently this has not been designed so that the Calendar opens up with a specific key as you said.However,you can inherit a Custom Control and override ProcessCmdKey and set any key to open up the calendar as illustrated below: protected override bool ProcessCmdKey (ref Message msg,Keys keyData) { if(keyData==Keys.O) { this.DisplayCalendar (); } return base.ProcessCmdKey (ref msg,keyData); } Also you can try using the DisplayCalendar() method of dateTimePickerAdv inorder to display the popUp when user tabs into the control. I have not reproduced the exact issue of PopUp flashing as you have said.However , try to use this method in your scenario and let me know whether you come across with the same issue. DisplayCalendar method is recently added to our control and if you are using any version prior to V3.3,you might not find this. Please let me know regarding this. Thank you for choosing Syncfusion products. Regards, Anu.


AD Administrator Syncfusion Team August 17, 2006 04:01 PM UTC

Hi,

I seem to have similar issue. I managed to open calendar popup window overriding ProcessCmdKey. I can focus the calendar, so choosing the date using arrow key is possible. Here is my code:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {

this.DisplayCalendar();
this.PopupWindow.Calendar.NoneButton.Focus();
SendKeys.Send("{TAB}");

Now I''d like to have some key press (Enter) to close the popup calendar and put the selected date into the DateTimePickerAdv. Unfortunatelly pressing enter moves the cell to the right.
How can I do this?

Thank you for your help

Marek Solarski


AD Administrator Syncfusion Team August 18, 2006 03:57 PM UTC

Hi Jonathan,

Sorry for the delay in response.I am working on this and will get back to you soon.

Regards,
Velmurugan E

Loader.
Live Chat Icon For mobile
Up arrow icon