Quote:
Originally Posted by Anar
Hi,
i want the user to be able to select null value from datetimepicker. i found that by using showcheckbox = true, i can control whether user needs to input value or not.
the problem is that i am using a validation, whereby
if the checkbox is not checked than it datetimepicker.value = ""
but it is giving me an error
please help with this
thanks
|
1. Bind your datetimepicker.text, not datetimepicker.value
2. Add this code in datetimepicker_Validating(object sender, CancelEventArgs e) event:
if (!datetimepicker.Checked)
((Order)orderBindingSource.Current).OrderDate= null;
I hope it works in your case