This is a migrated thread and some comments may be shown as answers.

Data Annotations on generated classes

1 Answer 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jaroslav Půbal
Top achievements
Rank 1
Jaroslav Půbal asked on 13 Oct 2010, 01:52 PM
Hello,
we have generated data classes from WCF (not RIA).
We looking for declarative constraints on data layer. Not only validation (showing red message) but inplace editing constraint (for example max length). 

DataAnnotations seem to be the right solution.


1) Is DataAnnotations supported in all telerik controls like MaskedTextBox, DatePicker, ..? (In RadControls_for_Silverlight_2010_1_0309 working for me only on RadGrid ?!).

2) Is any chance to define DataAnnotations on client side (not on generated classes) ? Define on 'Partial' co-class? Define MetadataTypeAttribute like on server side?

3) Any global hook in Telerik Controls for custom runtime programable constraint? (Probably not good idea :-) )

1 Answer, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 19 Oct 2010, 01:29 PM
Hello Jaroslav Půbal,

 Currently we don't support DataAnotations for the Input controls like MaskTextBox and so on. But we may consider implement it for the future. You can create the proper mask for the Mask input based on the DataAnotaions provided by the entities - but you should do this by your own.

For me personally the best validation solution in based in the ViewModel and choose between the built in approaches like implementing Validation interfaces or throwing exception and using binding.
If we can be of further help. 

Sincerely yours,
Miro Miroslavov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jaroslav Půbal
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Share this question
or