RadListBox + CheckBoxes + Validation Callout Extenders

2 posts, 0 answers
  1. Thad
    Thad avatar
    106 posts
    Member since:
    Sep 2010

    Posted 17 Feb 2011 Link to this post

    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.

    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"?

  2. Dimitar Terziev
    Dimitar Terziev avatar
    1268 posts

    Posted 23 Feb 2011 Link to this post

    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".

    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!
Back to Top