Default error messages and localization

Grids for WPF Forum

Posted 15 years ago by Rick Edwards - UK
Version: 9.1.0502
Avatar
Hi,

I'm trying to localize the default error messages shown in the PropertyGrid, for example when a user enters text instead of an integer. Where are these strings and how do I localize them, they're not viewable in the String Resource Browser (or at least I haven't found them)? How do I override the string format?

Sorry if this is not a PropertyGrid related issue, the boundaries between the Grid and general WPF issues are still a bit fuzzy for me!

Cheers

Rick

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Rick,

Sorry for the late response, I must have missed the email that says you posted.

The error messages you are seeing are not related to the PropertyGrid. Ultimately, the error is raised by the Int32Converter (for integers), which leverages the int.Parse method. This works just like if you bound a TextBox to an integer property. The int.Parse would raise an exception if it can't convert it.

You could do a couple of things:

1. Use a property editor that doesn't allow invalid text. You could use our Int32EditBox control in our Editors for WPF product, or you could build your own custom TextBox.

2. You could use a custom TypeConverter (e.g. MyInt32Converter), which functions like the Int32Converter, and then raise your own exception.

There's probably more you could do, but those are the things that I can think of initially.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.