M
moondaddy
I have a sample data entry form where I want to bind the controls to
properties residing in the supporting business class for better handling of
business logic (as apposed to binding straight to a dataset). My old way is
to manually load data into each control via a SetState method and writing
data to the biz class would be performed on the TextChanged event. I was
interested in seeing if there was a better way to do this such as binding
the textbox to the property in the biz class. However, one thing that may
not work too good for example is when I need to enter a date value. The
date value gets tested in the property to see if its a valid date. If not,
then it sets the property back to the original value, otherwise the new
value is written to the property. In the Leave event the value of the
property is written back to the control so the control is assured to have a
valid value in it. This might be too complicated of process for simply
binding the textbox to the property. Is there a good .NET way of doing
this?
properties residing in the supporting business class for better handling of
business logic (as apposed to binding straight to a dataset). My old way is
to manually load data into each control via a SetState method and writing
data to the biz class would be performed on the TextChanged event. I was
interested in seeing if there was a better way to do this such as binding
the textbox to the property in the biz class. However, one thing that may
not work too good for example is when I need to enter a date value. The
date value gets tested in the property to see if its a valid date. If not,
then it sets the property back to the original value, otherwise the new
value is written to the property. In the Leave event the value of the
property is written back to the control so the control is assured to have a
valid value in it. This might be too complicated of process for simply
binding the textbox to the property. Is there a good .NET way of doing
this?