DateTime Bound to TextBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have bound a DateTime field in a DataTable to a TextBox field. Other
String and Numeric fields are also bound to separate TextBoxes. If a new
DataRow is created and a DateTime value is entered no problem. However,
after the row is saved, I am unable to clear the date from the textbox.

I do not have this problem when binding to a DataGrid. But a DataGrid is
far from user friendly and just plain impractical in many situations.

In its place I am loading the DataRow into a class and using unbound fields
on the form. Bound controls seem great for strings. But thats about it.
Does anyone have a better solution?

Thanks
 
Sijin,
I'm a bit confused about the meaning of an empty DateTime.
Are you saying set this field to DBNull in the Parse event? Because
a DateTime cannot be set to null. The runtime throws an error.
Thanks
 
Back
Top