Squall_FF8 0 Posted 10 hours ago Hi guys, I use TDateTimePicker, but I cant find a method to "nullify" it. The value will be passed to SQL query, so I would like to be able to pass Null. P.S. I have 2 pickers, one for date and one for time. They both should be able to pass "no value" (null). Share this post Link to post
Stano 145 Posted 10 hours ago See if it has an option like "Enable null". I don't work with that. So I don't know. Share this post Link to post
PeterBelow 249 Posted 9 hours ago 1 hour ago, Squall_FF8 said: Hi guys, I use TDateTimePicker, but I cant find a method to "nullify" it. The value will be passed to SQL query, so I would like to be able to pass Null. P.S. I have 2 pickers, one for date and one for time. They both should be able to pass "no value" (null). The control has a ShowCheckbox property. This gives the user a checkbox to check or uncheck to indicate a NULL or NOT NULL state. The Checked property then tells you the user's descision. A bit cumbersome but the Windows common control behind TDatetimepicker has no concept of an "empty" state. Share this post Link to post
Squall_FF8 0 Posted 8 hours ago (edited) 3 hours ago, PeterBelow said: The control has a ShowCheckbox property. This gives the user a checkbox to check or uncheck to indicate a NULL or NOT NULL state. The Checked property then tells you the user's descision. A bit cumbersome but the Windows common control behind TDatetimepicker has no concept of an "empty" state. Thank you very much! Great idea! It seems that the check plays the role of Enabled: On/OFF, so disabled (grayed text) is visually good enough hint for: no value. It is strange that VCL lacks that option. FMX has IsEmpty on its pickers. Usually FMX lacks things that VCL has 🙂 EDIT: Actually above works only, if the ShowCheckbox is True 😞 Edited 5 hours ago by Squall_FF8 Share this post Link to post