Posted 22 November 2022, 7:11 am EST - Updated 22 November 2022, 7:16 am EST
Hi C1,
see attached sample: DateEditCustomFormat.zip
It shows two problems:
Problem 1: I set a CustomFormat to “ddd dd MMM yyyy”.
Start the sample, and press the “TAB” key.
Now, the month name is displayed wrong - instead of “Mär” it is the full month name “März”.
Problem 2: I use “PostValidation” intervals to restrict the entered date range. But I don’t find a way to define those intervals in a way that works.
This is from old code that worked with the .NET4.5.2 version:
this.c1DateEdit1.PostValidation.Intervals.AddRange(new ValueInterval[] {
new ValueInterval(new System.DateTime(1753, 1, 1, 0, 0, 0, 0), new System.DateTime(9998, 12, 30, 0, 0, 0, 0), true, true)});
This does not work - whenever you type in a date (e.g. “31 3 2022”) and tab out of the control, a validation error is shown:
I also tried to specify the “ValueInterval” in different string formats, but all don’t seem to work.
How to do you do this correctly? In WinForms designer for this property, there seems to be only a textfield to specify the date value, but no hint about the format.
Those two are rather urgent issues, as we are planning to release our .NET6 version soon, and found those issues in testing.
I think I don’t need the PostValidation ranges, but the display issue is also a major problem.
Best regards
Wolfgang