Hello,
I'm using a custom control called datetimeslicker which inherits from the datetimepicker contro
and it allows you to bind null values to datetimepickers , the code for this is attached
However I'm binding such a control (dtsFixedDate) to a class property Fixeddat
The binding is performed as follow
Public Sub BindDateTimeSli ckerField(ByVal strBoundfield As String, ByRef MyBoundSource As Object, ByVal strBoundTo As String, ByRef MyDateControl As datetimeslicker
MyDateControl.D ataBindings.Cle ar(
Dim MyBinding As Binding = New Binding("text", MyBoundSource, strBoundTo
MyDateControl.D ataBindings.Add (MyBinding
End Su
ps myboundsource is a class and strboundto is the member of the clas
When the binding is changed I change the value of the show checkbox and checked fields depending on whethe
the bound field is null or not as shown below
Private Sub SetDateTimeSlic kerCheckBox(ByV al StrSourceDate As String, ByRef MyDateTimeSlick er As Umbrae.Windows. Forms.DateTimeS licker
If IsDBNull(StrSou rceDate) Or StrSourceDate = "" The
MyDateTimeSlick er.Checked = Fals
MyDateTimeSlick er.ShowCheckBox = Tru
Els
MyDateTimeSlick er.Checked = Tru
MyDateTimeSlick er.ShowCheckBox = Tru
End I
End Su
MY PROBLEM IS THAT WHEN i UNCHECK THE CONTROL WHICH IS BOUND TO A NULL VALUE IT WILL NOT LET ME RE-CHECK IT AND ENTER ANY DATES
any idea what is going on here, any help would be greatly appreciated
the source of the control can be found on the page below
http://www.codeproject.com/cs/miscct...7Cpicker%7Cnul
David