ListView Selection Validation

2 posts, 0 answers
  1. Jamie
    Jamie avatar
    2 posts
    Member since:
    Aug 2012

    Posted 22 Apr 2013 Link to this post


    Is it possible to validate the selection (not editing) of a ListView? In other words to use the validator to verify that an item is selected in the listview when the selection mode is set to 'Single'?

    This seems like it would be a fairly straightforward thing to require, but I've tried just adding the 'required' attribute to the div, but it doesn't seem to make any difference....

    Thanks in advance,

  2. Alexander Valchev
    Alexander Valchev avatar
    2895 posts

    Posted 24 Apr 2013 Link to this post

    Hello Jamie,

    Kendo UI validator is intended to provide validation for input elements and works on the basis of HTML5 validation attributes. That said, it is not possible to make a ListView widget required - the <div> element is not an input and does not have required attribute.

    As a workaround I can suggest using a custom rule bound to a hidden input. This will let you to write your own validation function which will check whether there is a selected item. You would also have to customize the tooltip position and display it near the widget.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top