This project has moved. For the latest updates, please go here.

PropertyGrid validation

Jan 23, 2012 at 4:54 PM

The PropertyGrid is very promising.  

Is there an easy way of performing validation for each property?  Basic stuff like StringLength or maybe a RegEx?  And full custom validation?

Also is there a way of showing the text value for a property in bold if it has been changed by the user?  (like the Winforms PropertyGrid does if it the value is set to something other than the property descriptor DefaultValue)??

Thanks....

Jan 23, 2012 at 5:05 PM

If you need validation, you can try using custom editors.  There is currently no builtin support for validation.  Also currently there is no feature that turns text to bold when it changes.  Although that wouldn't be difficult to implement.  I will add it to my backlog.

Jan 23, 2012 at 6:53 PM

Thanks for the super prompt reply!

Will try the custom editors for validation.

And thanks for considering the facility to make the text bold when it changes. How would you approach this? I'm desperately trying to get more wpf knowledge but wouldn't know where to implement that!

Oh and one other thing I forgot to mention...my property editing is in a modal dialog with an ok/cancel dialog. How would you defer the real object being updated until the user pressed the ok button?

Thanks again, great toolkit and I will be rating to reflect that!

On 23 Jan 2012 18:06, "brianlagunas" <notifications@codeplex.com> wrote:

From: brianlagunas

If you need validation, you can try using custom editors. There is currently no builtin support for validation. Also currently there is no feature that turns text to bold when it changes. Although that wouldn't be difficult to implement. I will add it to my backlog.

Read the full discussion online.

To add a post to this discussion, reply to this email (wpftoolkit@discussions.codeplex.com)

To start a new discussion for this project, email wpftoolkit@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Jan 23, 2012 at 7:11 PM

Well, off the top of my head I could create another property to store the old value and then add a trigger to the control template that would modify the text color if the old value and new value don't matchy.  Another option would be to store the old value in the tag of a propertyItem and then have a trigger which compared the values.  Won't really know until I dig into it.

Well since you are using data binding you will probably need to create a copy of your object for editing.  When editing is completed, you can copy the values back to your real object.

Jan 23, 2012 at 7:13 PM

Thanks Brian!

On 23 Jan 2012 20:11, "brianlagunas" <notifications@codeplex.com> wrote:

From: brianlagunas

Well, off the top of my head I could create another property to store the old value and then add a trigger to the control template that would modify the text color if the old value and new value don't matchy. Another option would be to store the old value in the tag of a propertyItem and then have a trigger which compared the values. Won't really know until I dig into it.

Well since you are using data binding you will probably need to create a copy of your object for editing. When editing is completed, you can copy the values back to your real object.

Read the full discussion online.

To add a post to this discussion, reply to this email (wpftoolkit@discussions.codeplex.com)

To start a new discussion for this project, email wpftoolkit@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Jan 26, 2012 at 12:45 PM

Hello,

I also will be glad to have this feature... ( for Client configuration that base on Server configuration )

In my case it will be nice to have 2 objects, one for the default values (in my case it is the configuration data from the server) and the other is the edit one (in my case it is the configuration data that client can change)

 

Also it will be nice to have "Back to default" command - to restore one or all default values

 

Isaac Dagan