Example of ValueRange

Thread is closed for posting
2 posts, 0 answers
  1. Hong
    Hong avatar
    15 posts
    Member since:
    Dec 2012

    Posted 06 Feb 2015 Link to this post

    I am wondering if anyone could point me to an example of using attribute ValueRange in a model for DataForm control.
    The following usage is not allowed.

            [ValueRange(MaxValue=100, MinValue=0)]
            public int Quality

  2. Ivaylo Gergov
    Ivaylo Gergov avatar
    691 posts

    Posted 11 Feb 2015 Link to this post


    The ValueRange attribute requires its MaxValue and MinValue properties to be of type double. For example:

    [ValueRange(MaxValue = 100.0, MinValue = 0.0)]

    Please, let me know should you need further assistance.

    Ivaylo Gergov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top