I have a date picker on a form that is attached to a table. When there is a null value in the table the datepicker comes up with todays date. Is there a way to set it so it comes up blank when the datevalue in the table is null.
i do not think so since the datevaluepicker.value needs to be a datetime datatype. as far as I know there is no such thing as a null data value. it needs to be a valid date. What you can do though is detect that the value from the db is null and then sent it to datetime.minvalue or datetime.maxvalue. What is your goal is setting the datetime to a null-like value? Do you want force the user to select a valid date? If so, then setting the date to min or max will work. Just before you submit the form, see if the value is min/max and thrown a message to the user telling them they need to manually select a valid date.
Here is a tip though, I have had issues with DateTimePicker value being sent to min/max. So what you can do is set the value to a year after min or a year before max.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.