property dirty checking

  • Thread starter Thread starter Erik Frey
  • Start date Start date
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
 
Erik:

You don't need a dirty flag if you are databinding...instead, use the 'built
in' one called DataSet.HasChanges.
 
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
 
Back
Top