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

restrict user from selecting different items

1 Answer 70 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sigma
Top achievements
Rank 1
Sigma asked on 04 Jan 2013, 11:28 AM
hii,
I have a radcombobox with 2 items. How can i restrict the user from selecting the second item?

Thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Jan 2013, 11:42 AM
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.
Tags
ComboBox
Asked by
Sigma
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or