Drag a UltraDateTimeEditor to a form, binding it to DateOfBirth, set control to Nullable. When run it, 1/1/1970 is bound to the control; When using delete key or space key to blank our the value, it shows as __/__/_____, but I can't move focus to other control, and it always displays as __/__/_____.
What's wong with that? Version info: Infragistics2.Win.UltraWinEditors.v10.1, Version=10.1.20101.1007
Thanks for help!
My first guess is that you have the control bound to a field that does not allow nulls.
Try trapping the Validating event on the control and see if it's firing. If so, what is e.Cancel set to?
The Validating Event is firing when I try to click on other control and e.Cancel is false;
The control is bound to a nullable DataTime field from dataRow.
Thanks!
It is solved by changing the Auto Validate prop of the container to EnableAllowFocusChange.
I don't have other validation on the form and nothing is required. When DateTimeEditor is nullable, I would expect null value will pass the validation. I know DateTime doesn’t allow null value, so in the ValueChanged event, I tried to set bound field to DBNull, but it still can’t lose focus if I don’t set the container to EnableAllowFocusChange. Is it a bug or by design?
Hi,
What property of the UltraDateTimeEditor are you binding to?
Does it work okay if the control is not bound? If so, then it's not the UltraDateTimeEditor validation that is failing, it's the data source validation. Are you sure your data field allows nulls? What kind of date source are you binding to?
If you still have a problem when the control is not bound, then my best guess is that this is a bug in the version of the control you are using.