IsDirty Question?

  • Thread starter Thread starter Mary
  • Start date Start date
M

Mary

Is there a good document online on how to implement IsDirty for Winforms? I
am having on how to design for IsDirty. My forms have alot of controls that
the user will need to input before the user can advance to other parts of
the application. Should I have one IsDirty flag for each form and for every
validated event for each control have it set to true if data is validated?
Any ideas?

Thanks
 
You may not need a IsDirty at all. You can put code behind the Validating
event, that's what it's meant for in general, but remember that it will put
focus back to the current control if validation fails.... You could do
something like write one event handler for everything that falls through the
controls as well. Another easy way is just call a validate routine from
each control and set the enabled property of your ContineButton equal to the
return value of your function. You may also want to check out the error
provider control...

these should help: http://www.knowdotnet.com/articles/validating.html

http://www.knowdotnet.com/articles/thedotnetway.html
 
Thanks for the post. I do validate my controls however I need to know if
something has changed. So, I use IsDirty flag to tell my app that I needs
to resave the data because something has changed.

Thanks
 
Back
Top