How can I cancel the Date.Parse event or only allow a specific date format before the event fires? I only want the ValueChange event to execute when the date's format is MM/dd/yyyy.
If your goal here is that the ValueChanged event does not fire (and the value is not actually changed) as the user types, but only after they leave the control, then you might consider replacing your UltraDateTimeEditor with the UltraCalendarCombo control.
The advantage is that this control doesn't attempt to parse the text until the user leaves the control.
The only potential down side is that there is no masking. The text entry is freeform. That means the user has to type in the slashes for a date.
Hello Jason,
After investigating this and doing some research, preventing the editor from auto filling in the date and forcing the user to enter a full year before exiting edit mode has been determined to be a product idea. You can suggest new product ideas for future versions by submitting to the Product Ideas page.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. You can also link back to this thread for additional details.Thank you in advance to submitting your product idea.
Include a link to this thread in your idea so product management will be able to look back at this thread.
I am adding an example project that shows what my issue. DateTimeEditorDateParse.zip
The problem is when BeforeExitMode is called. If the current controls DateTime value is 08/30/2018 and if BeforeExitMode is fired the controls Current Text: 08/30/___2 then the control will parse that to the new Date: 08/30/2002. Even if I cancel the BeforeExitMode the new DateTime has already been updated.
The new DateTime value will replace the original value and update the controls.Text value to the new DateTime.
Thank you for contacting Infragistics!
Instead of canceling the Data.Parse I would recommend you setup a MaskInput for the editor this way you can control how the date is input.