ICustomTypeDescriptor object validation

2 posts, 0 answers
  1. Vladimir
    Vladimir avatar
    11 posts
    Member since:
    Oct 2010

    Posted 13 May 2014 Link to this post

    RadDataForm does not validates correctly objects inherited from ICustomTypeDescriptor because it uses standard Validator.TryValidateObject method which works with standard reflection. Insteed it must use internal dynamic PropertyDescriptors and validate object by them.

    public bool ValidateItem()
                Validator.TryValidateObject(CurrentItem, new ValidationContext(CurrentItem, null, null), validationResults, true);

  2. Ivan Ivanov
    Ivan Ivanov avatar
    1114 posts

    Posted 15 May 2014 Link to this post

    Hi Vladimir,

    Would you please clarify, how do you implement your validation rules? We would appreciate a sample dummy project with your scenario that we can test on our side.

    Ivan Ivanov
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft R3 2016 release webinar banner
Back to Top