DateTime Bound to TextBox

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top