Re: Validate on save?

Re: Validate on save?

Old forum URL: forums.lhotka.net/forums/t/3046.aspx


ozitraveller posted on Sunday, June 17, 2007

Hi

I have one form in my app that is setup for dataentry, and the operator get quite annoyed by field by field validation. So I want to implement validation on save with a dialog of the errors.

So I'm wonder how I would go about this with csla?

Also how do I disable the Save button until some data is changed?

Any help would be greatly appreciated.

Thanks

RockfordLhotka replied on Sunday, June 17, 2007

This article shows how to bind to IsDirty/IsValid/etc.

http://www.lhotka.net/Article.aspx?area=4&id=5faaee8e-8496-4845-86f7-787c6b64096c

To do your validation at save time instead of per-field, just don't put an ErrorProvider control on your form (that eliminates per-field notification) and add a bit of code behind your save button click handler to see if the object is valid. If not, use the broken rules collection to build your error dialog.

I do exactly this in the PTWeb code - look at the ProjectEdit page for example.

ozitraveller replied on Monday, June 18, 2007

Thank you Rock, I appreciate your time.

Copyright (c) Marimer LLC