In the Telerik documentation for the RadComboBox client object model it gives this information for clearing the selection.
ClearSelection
<
script
>
function ClearSelection()
{
var combo = <%=RadComboBox1.ClientID %>;
combo.ClearSelection();
}
</
script
>
You can see this code on this page
http://www.telerik.com/help/aspnet/combobox/combo_client_model.html
This code does not work. The first line 'var combo....' fails to execute. Even having this code on the page gives me this error that appears as a little green line under the < character.
Expected Expression
I was able to fix this code with some jQuery (note my combo box has a different name.)
var combo = $find("<%#radCustomSearchDropdown.ClientID %>");
This line works as you can see in the attached image. combo now points to the RadComboBox.
But my problem did not stop there.
Once this line is executed Firebug report the following error.
combo.ClearSelection is not a function
For reference my Combo Box looks like this
<
telerik:RadComboBox
ID
=
"radCustomSearchDropdown"
runat
=
"server"
Height
=
"200px"
Width
=
"200px"
DropDownWidth
=
"350px"
EmptyMessage
=
"Custom Search"
HighlightTemplatedItems
=
"true"
EnableLoadOnDemand
=
"true"
Filter
=
"StartsWith"
OnSelectedIndexChanged
=
"radCustomSearchDropdown_SelectedIndexChanged"
AutoPostBack
=
"true"
>
<
ItemTemplate
>
<
table
style
=
"width: 275px"
cellspacing
=
"0"
cellpadding
=
"0"
>
<
tr
>
<
td
style
=
"width: 260px;"
>
<
strong
><%# DataBinder.Eval(Container, "Attributes['Title']")%></
strong
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"width: 260px;"
>
<
i
><%# DataBinder.Eval(Container, "Attributes['Description']")%></
i
>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
Note that I do have the RadComboBoxScripts.js file included in my page.
Where is combo.ClearSelection?
I just want a client side method to reset the combo box. Any help would be much appreciated.