Couple of newbie PropertyInfo Questions

Couple of newbie PropertyInfo Questions

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


dagware posted on Monday, October 06, 2008

I'm trying to get my head around using PropertyInfo, and I have a couple of questions:

1) If the property is a SmartDate that has a FormatString, will SetProperty wipe out its FormatString?

2) Are there any options available to have SetProperty automatically trim string values, either trailing or leading & trailing?

Thanks.

Dan

RockfordLhotka replied on Monday, October 06, 2008

1. When a value type property (like SmartDate or int) is replaced by another value, SetProperty and LoadProperty should carry any metadata from the previous value forward. That should include the FormatString. Is this not what you are seeing?

2. Yes, you can create a custom business rule (a "validation" rule that always returns true) to modify the property value.

dagware replied on Wednesday, October 15, 2008

Sorry I didn't respond sooner. I got sidetracked.

RockfordLhotka:

1. When a value type property (like SmartDate or int) is replaced by another value, SetProperty and LoadProperty should carry any metadata from the previous value forward. That should include the FormatString. Is this not what you are seeing?

I haven't tried it yet -- I was just asking.


2. Yes, you can create a custom business rule (a "validation" rule that always returns true) to modify the property value.



Cool idea! I'll definitely try it. Thanks!!!

Dan

Copyright (c) Marimer LLC