[RESOLVED] datetimepicker doesn't display what I want
I have a datetimepicker (DTP). The DTP is bound to a table date field so that the date picker displays the date from the field. Nice, I like that.
I would like the DTP do one other thing and that is to display nothing if the field that it is bound to is empty. The problem is I am unable to figure out how to set a property for the DTP to display no date.
I know that a DTP is normally used with a textbox, but if I can just get this thing to work with an empty field I have no need for the textbox. Is there something really obvious in the properties that I am missing? Will the DTP not display nothing?
Re: datetimepicker doesn't display what I want
Re: datetimepicker doesn't display what I want
Thanks. It went something like this:
Code:
If Not String.IsNullOrWhiteSpace(lblDate.Text) Then
dtEnd.DataBindings.Add("Text", MasterBase.listTable, "colEndDate", True, DataSourceUpdateMode.OnValidation, DateFormat.ShortDate)
Else
dtEnd.Format = DateTimePickerFormat.Custom
dtEnd.CustomFormat = " "
End If
However, there must be at lease one space between the quotes. Without the space you get the default date.
Thanks a lot!