databinding question

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
 
C

Cor Ligthert [MVP]

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
 
R

RobinS

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.
 

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

Similar Threads


Top