title: Can't escape empty textbox
body: <p>I'm trying to track down the cause of an annoying interface bug in an app that was recently upgraded from VS2003 to VS2008 (the bug did not exist pre-migration).
  What happens is this :</p>
  
  <p>1) User clicks in textbox containing a date.<br>
  2) User clears date<br>
  3) User tries to move to another field, but can't. No error messages appear - it's as if the validation failed.</p>
  
  <p>Further info :</p>
  
  <p>1) The textbox's Text property is bound to a dataview which uses a datatable as its source. The bound field is a nullable datetime field with no constraints or default.<br>
  2) The Validating event fires and the CancelEventArgs property is not set to Cancel. The Validated, LostFocus and Leave events all fire as well, going LostFocus > Leave > Validating<br>
  3) I can't see any code changes relating to the control or the datasource with a couple of exceptions. The first is that this :</p>
  
  <pre><code>Me.txtRangeEnd.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.dvClientNos, "RangeEnd"))
  </code></pre>
  
  <p>has now changed to this :</p>
  
  <pre><code>Me.txtRangeEnd.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.dvClientNos, "RangeEnd", True))
  </code></pre>
  
  <p>The second is that this :</p>
  
  <pre><code>Me.dcolRangeEnd.DataType = GetType(System.DateTime)
  </code></pre>
  
  <p>has now changed to this :</p>
  
  <pre><code>Me.dcolRangeEnd.DataType = GetType(Date)
  </code></pre>
  
  <p>There is also this, which has been in the code since day one :</p>
  
  <pre><code>AddHandler txtRangeEnd.DataBindings("Text").Format, AddressOf FormatBoxToDate
  
  Private Sub FormatBoxToDate(ByVal sender As Object, ByVal e As ConvertEventArgs)
  Try
      If Not e.Value Is DBNull.Value Then
              e.Value = Format(e.Value, "d")
          End If
      End Try
  End Sub
  </code></pre>
  
  <p>Now, if I remove the ", True" from the adding of the databinding then I can exit the control with a blank value, but it then reverts to the original value. Removing the date formatting appears to make no difference to this (it just reverts to showing 06/01/2011 00:00:00 rather than the desired 06/01/2010). No other code refers to that textbox at all. I'm thinking something must have changed in validation of databound controls between VS2003 and VS2008, but it's just as likely I'm missing something mind-numbingly obvious.</p>
  
  <p>Any ideas?</p>