R – Silverlight 3 – dataform errorsummary with RIA validation

silverlightsilverlight-3.0

I got a dataform partially working with RIA services (I can fetch and edit data).

The problem is that I added validation to my RIA service fields. Ex: from my metadata.cs file

[StringLength ( 50, ErrorMessage= "bad data dude!" , MinimumLength=4)]
public string Title;

In the dataform, when a user enters data violating the above rule, an exception is thrown saying "bad data dude!" which is sort of OK. The problem is that I would like the data form to show this message in the error summary?

What am I doing wrong?

Best Answer

Visual Studio breaks because it sees an error it believes is not handled. If you just continue the program the error will be handled and the failed validation will show as expected.

You can tell VS not to stop on an user unhanded ValidationException using the Debug/Exceptions dialog in VS.

Related Topic