Telerik RadComboBox: Readonly

Had to implement a readonly mode for a radcombobox, and learned read-only isn’t supported on this control.

Here’s how I simulated it (Note: The items are loaded in code-behind, but that’s irrelevant to this behavior) :

<script type=”text/javascript”>

var n;
n = $find(“<%= rcbMyControl.ClientID %>”);
n.readOnly = true;
n.set_changeText(false); // Prevent keyboard nav from changing the selected item.
n.add_dropDownOpening(function(s, e) { e.set_cancel(true); }); // Prevent the dropdown from opening
</script>

<telerik:RadComboBox ID=”rcbMyControl” runat=”server” AllowCustomText=”false” EnableLoadOnDemand=”false”>
</telerik:RadComboBox>

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *