restrict user from selecting different items

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 04 Jan 2013 Link to this post

    hii,
    I have a radcombobox with 2 items. How can i restrict the user from selecting the second item?

    Thanks
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 Jan 2013 Link to this post

    Hi,

    Try the following code snippet to achieve your scenario.

    JS:
    <script type="text/javascript">
        function OnClientSelectedIndexChanging(sender, args) {
            if (args.get_item().get_index() == 1) {
                args.set_cancel(true);
            }
        }
    </script>

    Hope this helps.

    Regards,
    Princy.
Back to Top