The ASP.NET Capsule #16: Bug in Telerik RadComboBox for ASP.NET AJAX (Workaround available)

Hi all.

I came across this bug when using Telerik RadControls for ASP.NET AJAX, more specific the RadComboBox. It’s a simple bug but might make you have a headache.

Description

You have a RadComboBox declared in your ASP.NET Webforms Page. For example:

<telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="Select a value from list…">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</telerik:RadComboBox>

Note the property EmptyMessage. This property will make the RadComboBox to show the message “Select a value from list…” when no selection has been made, or the selection has been cleared.

Problem

When calling the clearSelection() client side method for clearing the current selected item in the RadComboBox without user interaction. For example:

function ClearComboSelection() {

var combo = $find("RadComboBox1");
combo.clearSelection();

}

The RadComboBox  doesn’t show the value of the property EmptyMessage. It completely clears the text shown.

Workaround

Call the _applyEmptyMessage() method after calling clearSelection(). Example:

function ClearComboSelection() {

var combo = $find("RadComboBox1");
combo.clearSelection();
combo._applyEmptyMessage();

}

Solution

This has been confirmed to be a bug present in all versions of RadControls for ASP.NET AJAX. Support has logged into their bug tracking system and expect to get it fixed during next week.



Leave a Reply

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