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 question

In DateTimePickerAdv, one can use the arrow keys to go through the fields (Left+Right) and change them (Up+Down).

When I am on the date field, I want to move to the month (next field) if a letter is pressed, as this is most likely what the user means (he/she wants to type in the month, after typing in the date).

I am using CustomFormat, "dd MMM yyyy".

Is there a way to programatically check which field is one on and to move to a specific other field?

1 Reply

MU Murugan Syncfusion Team June 9, 2007 12:28 AM UTC

Hi Kamen,

This could be achieved by customizing the DateTimePickerAdv control and overriding the ProcessCmdKey method

[Code]
public class CustomDTPA : DateTimePickerAdv
{

public CustomDTPA(): base()
{
this.Format = DateTimePickerFormat.Custom;
this.CustomFormat = "dd mm yyyy";
}

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.A)
{
keyData = Keys.Right;
}
return base.ProcessCmdKey(ref msg, keyData);
}
}

Please refer to the code snippet above and let me know if it helps you.

Thank you for your interest in Syncfusion products.

Regards,
Murugan P.S

Loader.
Live Chat Icon For mobile
Up arrow icon