property dirty checking

E

Erik Frey

Hi,

Is there a way to implement dirty checking using databinding? I've
tried handling the BindingManagerBase.CurrentChanged event, but it only
fires after the user moves focus away from a control with changed text,
instead of firing when the user begins to type a new value into the control.

I just want to be able to tell if a databound property has changed,
regardless of whether the user has entered/left the control.

Erik
 
W

William Ryan eMVP

Erik:

You don't need a dirty flag if you are databinding...instead, use the 'built
in' one called DataSet.HasChanges.
 
E

Erik Frey

William Ryan eMVP said:
Erik:

You don't need a dirty flag if you are databinding...instead, use the 'built
in' one called DataSet.HasChanges.

William,

The problem with using DataSet.HasChanges is that it only turns true
after EndCurrentEdit has been called. There's this whole tier system to
databinding that you have to go through before actually affecting any change
to the datasource - Lose control's focus/EndCurrentEdit/AcceptChanges/etc.
While that model makes sense to me, I can't understand why MS didn't provide
some kind of event at the top of the tiers, that simply tells me when
someone has changed the value in a databound control property.

Someone mentioned handling keystroke events, and that may be my best
bet.

Erik
 

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