how to set null value or empty value to datatimepicker at runtime
Printable View
how to set null value or empty value to datatimepicker at runtime
Hi,Quote:
Originally Posted by karthikeyan
Well, the standard DateTimePicker does not support this feature,
however there are a lot of custom control which can support it.
http://www.codeproject.com/useritems/ketan.asp
http://www.codeproject.com/cs/miscctrl/Nullable_DateTimePicker.asp
http://www.codeproject.com/cs/miscct...timepicker.asp
Hope it helps,
sparrow1
Thanks sparrow1.
Yes, you can set it to null.
Set the ShowCheckbox property to True.
Then if Checked is True the value of the DTP will be whatever date is displayed.
If the Checked property is False tehn the Value property is Null.
Hi Rob,
I thought he was asking for a complete null value (empty datatimepicker).
With your suggestion the datatimepicker act like a enabled datatimepicker and you can still see the date.
Or am I wrong.
Wkr,
sparrow1
Yes it will but you can also make it "empty" too so no date is displayed when the checkbox is unchecked.
Set a CustomFormat of a space char when its unchecked. Then set the format back to its previous setting/format when checked.