0

Our DTO's are in a separate assembly, and this is being shared between the server (web api) and client (winforms). The DTO class use DataAnnotations heavily, especially for maxlength.

In our forms, we have to set the maxlength for each and every control. The controls are bound to the dto objects using bindingsource.

Is there a way to extract the dataannotations information and set the controls' maxlength automatically on loading the form?

Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
  • possible duplicate of [Get Data Annotations attributes from model](http://stackoverflow.com/questions/19638105/get-data-annotations-attributes-from-model) – Pete Garafano Oct 08 '14 at 12:07
  • possible duplicate of [How to retrieve Data Annotations from code? (programmatically)](http://stackoverflow.com/questions/7027613/how-to-retrieve-data-annotations-from-code-programmatically) – Abbas Oct 08 '14 at 12:09

0 Answers0