Grid Validation

4 posts, 0 answers
  1. Chad
    Chad avatar
    2 posts
    Member since:
    Jul 2012

    Posted 17 Dec 2014 Link to this post

    I have an MVC page that has many controls on it, including a Telerik MVC grid. Most of my editors are using DataAnnotations for validation (Required, Range, etc.). However, I'm trying to come up with a way to validate whether or not at least one item exists within the grid. Is there a way to do this? Nothing is jumping out at me in the documentation. Any help would be welcome!
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1444 posts

    Posted 19 Dec 2014 Link to this post

    Hi Chad,

    This can be done by using a custom validation rule on a hidden input with an explicitly specified tooltip position. I prepared a proof of concept example that you can check here.

    Regards,
    Alexander Popov
    Telerik
     

    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.

     
  3. Chad
    Chad avatar
    2 posts
    Member since:
    Jul 2012

    Posted 19 Dec 2014 in reply to Alexander Popov Link to this post

    Thanks, Alex, I've seen this in the documentation (although your example is easier to understand). However, I already have a validation message box that uses the DataAnnotations of .NET. Does this validator also populate the standard validation message box? Or do I have to have two different display areas for validation?
  4. Alexander Popov
    Admin
    Alexander Popov avatar
    1444 posts

    Posted 23 Dec 2014 Link to this post

    Hi Chad,

    Since this is a custom validation rule the Validator will automatically render the Tooltip, however you can override the position as shown in the example.

    Regards,
    Alexander Popov
    Telerik
     

    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