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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DateTimePickerAdv Bug

Thread ID:

Created:

Updated:

Platform:

Replies:

67897 Sep 4,2007 03:46 AM Sep 26,2007 06:54 PM Windows Forms 9
loading
Tags: Tools
Russell Coombes
Asked On September 4, 2007 03:46 AM

Hi Guys,

I *think* I have found a bug with the DateTimePickerAdv - I have replicated the problem in the attached sample project.

The scenario is this: I have created a DateTimePickerAdv on a form amongst other controls. The DateTimePickerAdv has a custom format of "dd - MMM - yy" and is then bound (through DataBinding) to a DateTime property on an object that contains all of the data for the controls. As the DateTimePickerAdv only displays two years, it correctly shows "07" when I bind a value of "2007". However, clicking away from the DateTimePickerAdv and then clicking back again seems to change the year value to "1907" for no apparent reason. If I change the custom format to "dd - MMM - yyyy" it works fine, but unfortunately, the requirement is to only display 2 year digits and not 4. Can you please confirm whether this bug exists and whether there will be a fix required?

Thanks!

Regards,
Russell

DateTimePickerAdvBug.zip

haneefm [Syncfusion]
Replied On September 4, 2007 02:26 PM

Hi Russell,

You can try setting the DateTimePickerAdv's DigitYear property is set to 2000 and let me know if this helps.

Thank you for the interest shown in Syncfusion Product.

Best regards,
Haneef

Russell Coombes
Replied On September 5, 2007 05:13 AM

Hi Haneef,

This does not help me at all.

Setting this value *does* prevent the year from changing from 2007 to 1907. But all this does is reverse the bug. Assume that I have a value of '1987' on an object bound to the DateTimePickerAdv. Clicking away from the DateTimePickerAdv and then clicking back to it causes the value to change to 2087, which is incorrect behaviour.

The 'Digityear' property is used when the user only adds the last two digits of the year - so if a user types '95' and the DigitYear is '2000' then the year value on the control becomes '2095' which is correct. However - just clicking away from the DateTimePickerAdv and clicking back again *should not* change the original value of the DateTimePickerAdv in any way at all.

I still consider this to be a bug that requires a fix.

Your feedback is much appreciated.

Regards,
Russell

>Hi Russell,

You can try setting the DateTimePickerAdv's DigitYear property is set to 2000 and let me know if this helps.

Thank you for the interest shown in Syncfusion Product.

Best regards,
Haneef

haneefm [Syncfusion]
Replied On September 5, 2007 11:39 AM

Hi Russell,

Thank you for your update.

One way you can solve this issue by handling the Leave event of the DateTimePickerAdv control and set the DigitYear property. Below are the codes that show this task.

dateTimePickerAdv1.Leave += new EventHandler(dateTimePickerAdv1_Leave);
dateTimePickerAdv2.Leave += new EventHandler(dateTimePickerAdv1_Leave);

void dateTimePickerAdv1_Leave(object sender, EventArgs e)
{
DateTimePickerAdv dTimePicker = sender as DateTimePickerAdv;
if (dTimePicker != null)
{
dTimePicker.DigitYear = ((int)(dTimePicker.Value.Year /100)) * 100;
}
}

Best regards,
Haneef

Russell Coombes
Replied On September 10, 2007 06:43 AM

Hi Haneef,

I'm afraid that this solution is no good to us. We may have many, many DateTimePicker controls on a form, and we cannot be expected to add this EventHandler for every single DateTimePickerAdv control that exists. Furthermore, this control will exist all through our application, so again, it is unreasonable that we'll have to keep adding this EventHandler all through our code.

Again, I re-iterate that the Year value is changing on its own by clicking off and back onto the DateTimePickerAdv - the value is NOT being changed manually by the user. Therefore, I believe that this is a bug with the control, and I would like a fix for it from Syncfusion that doesn't require me to have to update every single DateTimePickerAdv in our entire application.

Regards,
Russell

>Hi Russell,

Thank you for your update.

One way you can solve this issue by handling the Leave event of the DateTimePickerAdv control and set the DigitYear property. Below are the codes that show this task.

dateTimePickerAdv1.Leave += new EventHandler(dateTimePickerAdv1_Leave);
dateTimePickerAdv2.Leave += new EventHandler(dateTimePickerAdv1_Leave);

void dateTimePickerAdv1_Leave(object sender, EventArgs e)
{
DateTimePickerAdv dTimePicker = sender as DateTimePickerAdv;
if (dTimePicker != null)
{
dTimePicker.DigitYear = ((int)(dTimePicker.Value.Year /100)) * 100;
}
}

Best regards,
Haneef

Russell Coombes
Replied On September 14, 2007 04:56 AM

Hi Haneef,

I really need an update to this problem. Is this a recognised Syncfusion bug?

Regards,
Russell

>Hi Haneef,

I'm afraid that this solution is no good to us. We may have many, many DateTimePicker controls on a form, and we cannot be expected to add this EventHandler for every single DateTimePickerAdv control that exists. Furthermore, this control will exist all through our application, so again, it is unreasonable that we'll have to keep adding this EventHandler all through our code.

Again, I re-iterate that the Year value is changing on its own by clicking off and back onto the DateTimePickerAdv - the value is NOT being changed manually by the user. Therefore, I believe that this is a bug with the control, and I would like a fix for it from Syncfusion that doesn't require me to have to update every single DateTimePickerAdv in our entire application.

Regards,
Russell

>Hi Russell,

Thank you for your update.

One way you can solve this issue by handling the Leave event of the DateTimePickerAdv control and set the DigitYear property. Below are the codes that show this task.

dateTimePickerAdv1.Leave += new EventHandler(dateTimePickerAdv1_Leave);
dateTimePickerAdv2.Leave += new EventHandler(dateTimePickerAdv1_Leave);

void dateTimePickerAdv1_Leave(object sender, EventArgs e)
{
DateTimePickerAdv dTimePicker = sender as DateTimePickerAdv;
if (dTimePicker != null)
{
dTimePicker.DigitYear = ((int)(dTimePicker.Value.Year /100)) * 100;
}
}

Best regards,
Haneef

Russell Coombes
Replied On September 18, 2007 12:49 PM

Hello,

I am still waiting for a response from Syncfusion regarding this issue, some 14 days after I posted the incident on this forum.

It is one thing to ship your product with bugs. It is then another to ignore forum posts regarding the matter.

Please confirm whether the issue I have raised is a genuine bug, and advise when this issue will be resolved.

Regards,
Russell


>Hi Guys,

I *think* I have found a bug with the DateTimePickerAdv - I have replicated the problem in the attached sample project.

The scenario is this: I have created a DateTimePickerAdv on a form amongst other controls. The DateTimePickerAdv has a custom format of "dd - MMM - yy" and is then bound (through DataBinding) to a DateTime property on an object that contains all of the data for the controls. As the DateTimePickerAdv only displays two years, it correctly shows "07" when I bind a value of "2007". However, clicking away from the DateTimePickerAdv and then clicking back again seems to change the year value to "1907" for no apparent reason. If I change the custom format to "dd - MMM - yyyy" it works fine, but unfortunately, the requirement is to only display 2 year digits and not 4. Can you please confirm whether this bug exists and whether there will be a fix required?

Thanks!

Regards,
Russell

DateTimePickerAdvBug.zip

haneefm [Syncfusion]
Replied On September 24, 2007 01:55 PM

Hi Russell,

My sincere apologies for this delay in responding.

Currently, there is no built-in support for this. But one way you can do this by deriving the DateTimePickerAdv control and override the OnLeave method to set the DigitYear property of the DateTimePickerAdv. Below are the codes that shows this task.

public class MyDateTimePicker : DateTimePickerAdv
{
public MyDateTimePicker(): base(){}
protected override void OnLeave(EventArgs e)
{
this.DigitYear = ((int)(this.Value.Year / 100)) * 100;
base.OnLeave(e);
}
}

If still the issue exists, please create a direct trac incident in this regard and we can discuss further on this issue.

Also please do let me know if you have any other technical questions or I can be of any other assistance. I will be glad to assist you.

Best regards,
Haneef

Russell Coombes
Replied On September 26, 2007 08:51 AM

Hi Haneef,

I am unsure what you mean by 'no built-in support for this'. The DateTimePickerAdv is able to display Dates and Times, using a format that I specify (so long as the format string is valid). So it most DEFINATELY does have support for this. It's just that the control is buggy - and rather than admit it, I keep getting 'bodge-job' answers.

Do you seriously expect me to take a year number, divide it by 100, and then multiply it by 100 again? Furthermore, to complete your suggestion, I will have to ensure that every single DateTimePickerAdv control that we have in our entire project is changed to use a derived control that contains your hack just to prevent the Syncfusion DateTimePickerAdv from changing a value that it should not have changed in the first place.

As I have no reasonable resolution, I will take this issue to Direct-Trac.

Regards,
Russell


>Hi Russell,

My sincere apologies for this delay in responding.

Currently, there is no built-in support for this. But one way you can do this by deriving the DateTimePickerAdv control and override the OnLeave method to set the DigitYear property of the DateTimePickerAdv. Below are the codes that shows this task.

public class MyDateTimePicker : DateTimePickerAdv
{
public MyDateTimePicker(): base(){}
protected override void OnLeave(EventArgs e)
{
this.DigitYear = ((int)(this.Value.Year / 100)) * 100;
base.OnLeave(e);
}
}

If still the issue exists, please create a direct trac incident in this regard and we can discuss further on this issue.

Also please do let me know if you have any other technical questions or I can be of any other assistance. I will be glad to assist you.

Best regards,
Haneef

haneefm [Syncfusion]
Replied On September 26, 2007 06:54 PM

Hi Russell,

Thank you for creating the DirectTrac Incident. Your incident has been updated. Please feel free to reply the incident if you have any queries.

Best regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;