Can't cancel changes with failed validation rules

Can't cancel changes with failed validation rules

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


frankhoffy posted on Tuesday, August 28, 2007

I've been having an odd problem with one of my business objects.

I am using Windows Forms and version 3.0.1 of CSLA.  I have a form with some fields on it that let you edit information about a person.

My Person class is an editable root, and I am using binding.  I call EndEdit on the binding source to save the data on the form.  Under normal circumstances, this works fine.

If, however, one of my validation rules fails when I call EndEdit, I can't seem to cancel out the changes.  Calling CancelEdit on the binding source does nothing, and neither does calling CancelEdit on the object itself.

It almost looks like my state stack is getting messed up somehow.  Has anybody else run across this?  If so, how did you get around it?

RockfordLhotka replied on Tuesday, August 28, 2007

I've been working on the (hopefully) complete solution to this, and if you look at the C# code in svn for ProjectEdit in PTWin you should see the right answer. It does require a change in 3.0.2 of CSLA itself though too.

So I'm working on it, and hopefully will have a firm solution within the next week or so.

RockfordLhotka replied on Tuesday, August 28, 2007

OK, I got a refresh of 3.0.2 up - both VB and C# - with the (I believe) working PTWin code.

www.lhotka.net/cslanet/download.aspx

 

phucphlq replied on Tuesday, August 28, 2007

Thanks Rocky!

 


From: RockfordLhotka [mailto:cslanet@lhotka.net]
Sent: Wednesday, August 29, 2007 11:18
To: phucphlq@dsp.com.vn
Subject: Re: [CSLA .NET] Can't cancel changes with failed validation rules

 

OK, I got a refresh of 3.0.2 up - both VB and C# - with the (I believe) working PTWin code.

www.lhotka.net/cslanet/download.aspx

 



Copyright (c) Marimer LLC