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 Problems

Syncfusion 3.3.0.12
VS2003
Visual Basic

Hi Folks,

I am having some difficulties coding the datetimePickerAdv.

First, I want the format MM/dd/yyyy. When the user type 2 digits I want it to jump to the next field (working). I also want it to jump to the next field should the user press a '/'.

Is there a way to allow 2 digit year and supply a logical 2 digit century (07=2007, 99=1999)? This also leads me to the next challenge, default years. I might be wrong, but it seems like defaulting to either 2000 or 1900 only fits half the solution when both centuries are commonly entered. Sees like 2 digit dates 0-40 should default to 2000 and 41-99 to 1900 to be effective.

But my current problem is bigger. I created a basic form with only the datetimePickerAdv control. I have 1900 as digit year. I have format set to short. When I enter a year in the field, I cannot get it to format the year properly. In fact, unless I use the calendar and point to a date, I cannot change the year other than the rightmost digit. I cannot type in any 4 digit year. This must be a simple fix I am overlooking. Your demos seem to work but I cannot see any property settings that might cause this. I recently downloaded and installed 3.3.0.12.

I appreciate your help.

Tom





1 Reply

GR Golda Rebecal Syncfusion Team April 13, 2007 02:23 PM UTC

Hi Tom,

Issue 1: Forwarding to the next field when "/" key is pressed

You can achieve this by customizing DateTimePickerAdv and overriding the ProcessCmdKey method

//To forward to next field when "/" key is pressed

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (this.TabForwarding && msg.WParam.ToInt32() == (int)Keys.Divide)
{
SendKeys.Send("{Tab}");
return true;
}

return base.ProcessCmdKey(ref msg, keyData);

}

I have attached a sample that illustrates the same. Please have a look at it and let me know if this meets your requirement

Issue 2: Only the rightmost digit of the year field is edited when the format is set to Short

I am able to reproduce the issue in v3.3. I checked this issue in v4.4 and found it working fine. Could you please consider upgarding to this version? If so, you can download it from the following location:

http://www2.syncfusion.com/Installs/v4.4.0.51/SyncfusionEssentialStudioSetup.exe

Unlock Key : Please contact our sales team ( salessupport@syncfusion.com )

Thanks for your interest in Syncfusion products.

http://websamples.syncfusion.com/samples/tools.Windows/F59358/main.htm

Best regards,
Golda



Loader.
Live Chat Icon For mobile
Up arrow icon