databinding question

  • Thread starter Thread starter Wan
  • Start date Start date
W

Wan

Hi,
I have a vb.net form with some controls on it, let says, combobox,
text, comment, etc. databinding
to a dataset. I also have a save button that when click will update the
changes to a dataset. The save button is disabled when form is first
loaded. As soon as the user edits or changes one of the values in an
editable control, I would like to enable the save button. What is the
most efficient way to do this? I used in the past is to check
TextChanged (or ValueChanged or whatever) event of the control itself
to enable/disable save button. I'm open to ideas. Thanks for the
assistance.

Regards,
Wan
 
Wan,

If you use databinding, than the fields are from the second binding
parameter are always direct put in the properties as is described in the
first. To have an easy look at it, try this, drag 2 textboxes on a form and
than use this code in the load event.

textbox2.databindings.add("Text",Textbox1,"Text")

and try that.

There is no save button needed, that you can use to push the changed data
from your dataset in the database.

I hope this gives an idea.

Cor
 
I don't know of any way to do what you're talking about,
other than putting change events in all the textboxes.
On the bright side, you can subscribe all the textboxes'
change events to one routine. Same for the comboboxes.
Post back if you need some code to show you how to do that.

Robin S.
 
Back
Top