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 BindDateTimeSlickerField(ByVal strBoundfield As String, ByRef MyBoundSource As Object, ByVal strBoundTo As String, ByRef MyDateControl As datetimeslicker
MyDateControl.DataBindings.Clear(
Dim MyBinding As Binding = New Binding("text", MyBoundSource, strBoundTo
MyDateControl.DataBindings.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 SetDateTimeSlickerCheckBox(ByVal StrSourceDate As String, ByRef MyDateTimeSlicker As Umbrae.Windows.Forms.DateTimeSlicker
If IsDBNull(StrSourceDate) Or StrSourceDate = "" The
MyDateTimeSlicker.Checked = Fals
MyDateTimeSlicker.ShowCheckBox = Tru
Els
MyDateTimeSlicker.Checked = Tru
MyDateTimeSlicker.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