Apparent PropertyStatus Bug

Apparent PropertyStatus Bug

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


MadGerbil posted on Tuesday, October 11, 2011

I've a collection of objects in a datagrid which is bound to a CollectionViewSource.  The details of the selected item (or row) are shown in a details grid.   I can select an item on the grid and the details show up in the details grid.  This works well as a master/detail listing.

If I break a rule on the first item in the details grid the little read circle with exclamation point appears beside the field with the bad value.  I can navigate through the different items on the list and break different rules on different fields and everything stays in sync.  As I move through the list the UI shows valid and invalid values (with or without the property status) as expected.

The one exception is a field that has a Dependency rule.  If I break the dependency rule on one row the rule is broken on all objects (or appears to be broken on all objects) as I flip through the different records.

For example, if a First Name is required if a Last name is provided if I fill in the Last Name (while First Name is blank) I get the error status on the First name as expected but it shows up as broken on all items in the collection.  I've two items in the collection - one seems to impact the rules on that one field for the whole collection.   All of the other rules (non-Dependency property) work on an individual bases as expected.

Now what is even stranger is that if I place the Broken Rules collection for the entire collection into a Messagebox the broken rules seem to be working correctly.  That is, if I break that field on two objects I get two broken rules for that field.  If I fix one, the Broken Rules collection is reduced by that one item - even though teh UI shows the error status as error for all items in the collection.

It appears that the PropertyStatus box is out of sync with dependency rules - all the others work fine.

JonnyBee replied on Tuesday, October 11, 2011

Which version of CSLA are you using? 

I have updated PropertyStatus in CSLA 4.2 Beta to keep better sync and also update properly when using tab controls.
Business Rules and updates to the UI is also improved in CSLA 4.2 so it would really be helpful if you could test your project with the 4.2 Beta.

If it still fails then please post us a test/sample project to investigate/debug on.

MadGerbil replied on Tuesday, October 11, 2011

I'm using 4.1.0.

(Edited: Originally put 4.0.1)

JonnyBee replied on Tuesday, October 11, 2011

I spent a number of hours digging into bugs in PropertyStatus last summer so this control is updated and should be down ported into your version.

The updates to Business Rules for 4.2 (and especially concerning async rules that us AddOutValues) may also solve some issues here.

So there are some known bugs in 4.0.x/4.1.x and it would really be helpful to get feedback on whether 4.2 solves your issues or not.

MadGerbil replied on Tuesday, October 11, 2011

I just tested it and it seems to work really well.  :D

Are there other changes I should know about or should the rest of this work like 4.1.0 when it comes to WPF/Silverlight?

JonnyBee replied on Tuesday, October 11, 2011

The rule engine has some nice new features and a great rule library is available from http://cslagenfork.codeplex.com

And also look at the RuleTutorial sample (Samples\Net\cs\RuleTutorial)

I have a blog post on the updates: http://jonnybekkum.wordpress.com/2011/08/29/csla-4-2-rules-update/

And of course the change log for 4.2: http://www.lhotka.net/Article.aspx?area=4&id=2607a4ef-e6a9-4801-aa0b-518c51267339

AFAIK, there's a number of bugfixes and new features -  no breaking changes for WPF/Silverlight.

Copyright (c) Marimer LLC