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

ListView Selection Validation

1 Answer 265 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Jamie
Top achievements
Rank 1
Jamie asked on 22 Apr 2013, 03:25 PM
Hi,

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,

J.

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Apr 2013, 07:28 AM
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!
Tags
Validation
Asked by
Jamie
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or