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

RadListBox + CheckBoxes + Validation Callout Extenders

1 Answer 97 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Thad
Top achievements
Rank 2
Thad asked on 17 Feb 2011, 06:29 PM
Hey all,

A common subject is how to validate that a RadListBox with CheckBoxes="true" have at least one item checked (not selected).

Here is a post that explains a good solution to make it work.
http://www.telerik.com/community/forums/aspnet-ajax/listbox/radlistbox-checkboxes-true-and-requiredfieldvalidator.aspx

The solution above says we need to remove the ControlToValidate from the CustomValidator attached to the RadListBox.

This would work great unless you happen to use validation callout extenders to show a tooltip over invalid fields.  In this case, in order to position the tooltip, the validator must have a _controlToValidate property.

So how do we get the RadListBox to work with validation callout extenders?  In our case we dynamically add our validators to the page with extension methods.  I suppose we could add a custom attribute to the validators that would be like ControlToValidate2="rlbStates" and the callout extender could check this property if ControlToValidate was null...

Any ideas that are more "built-in" and less "hacky"?

Thanks!
Thad

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 23 Feb 2011, 01:39 PM
Hello Thad,

After a bit of research it seems to be a problem when using CustomValidator and ValidatorCallout Extender. This problem really appears when there is no ControlToValidate set to the CustomValidator. The client-side function for validation is executed, but the ValidatorCallout Extender get mixed up and thus fails the whole validation.
For now there seems to be no workaround for this problem, which appears to be a Microsoft controls compatibility issue.
Of course you could try the solution you have been thinking of , but this is as you have stated a bit "hacky".

Greetings,
Dimitar Terziev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
ListBox
Asked by
Thad
Top achievements
Rank 2
Answers by
Dimitar Terziev
Telerik team
Share this question
or