Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data bound datetimepicker control with checkbox How to handle Null

Status
Not open for further replies.

cluelessAnyAdvise

Programmer
Jun 24, 2005
17
US
Hi

I have a dateTimePicker control on a Windows Form (VB.NET),
which is bound to a dataset (database column of date type).

Following properties are set -
editfldName.Checked = False
editfldName.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.dsName, "tblName.fldName"))
editfldName.ShowCheckBox = True

As I understand it is not possible to set a DateTimePicker to null value (if the DB column has null). So there is no way to blank out the field's text itself. Currently it shows the default date (Date.Now) when dataset column has no date in it. The check box next to it is always checked once the data is loaded on the form.
So there is no visual indication for the users to determine if the value shown is from dataset or default.
So I'd like to see -
checkbox as checked if the value in <editfldName> is the one from dataset column.
checkbox as NOT checked when the value is default value of datetimepicker (ie. Date.Now)

Any suggestions?

Thanks






 
DataGrid Column has AllowNull property. But I don't see one for datetimepicker...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top