Hi all,
I have a problem using the SetText() and ClearSelection() function over a RadCombobox control, using javascript for client side execution of the code.
Probably the code explains better than words:
My controls are:
<td>
<telerik:RadComboBox ID="cmbStato" runat="server" EmptyMessage="Insert control form status..."
DataTextField="Description" DataValueField="Id" Filter="Contains"
AllowCustomText="true" DataSourceID="LinqDataSourceStato">
</telerik:RadComboBox>
</td>
<td width="18" style="padding-left: 5px;">
<asp:ImageButton ID="imgClearStatus" runat="server" AlternateText="Clear selection"
ImageUrl="_LAYOUTS/IMAGES/Iacopo/eliminaOn.gif" OnClientClick="ImgClearClick(this.getAttribute('id'))"
Width="14" Height="14"/>
</td>
When I click on the ImageButton I want to clear the content of the ComboBox. Here following my javascript code:
function ImgClearClick(item) {
var combo = $find("<%= cmbStato.ClientID %>");
//combo.disable(); //WORKS!!
combo.SetText(''); //DOESN'T WORK
combo.ClearSelection(); //DOESN'T WORK
// var str = combo.GetValue(); //DOESN'T WORK
}
I also put commented tests I have done that were working or not. In particular the disable/enable funcions work properly.
Thanks in advance for any help you can give me.
Regards,
Dario Zanelli
I have a problem using the SetText() and ClearSelection() function over a RadCombobox control, using javascript for client side execution of the code.
Probably the code explains better than words:
My controls are:
<td>
<telerik:RadComboBox ID="cmbStato" runat="server" EmptyMessage="Insert control form status..."
DataTextField="Description" DataValueField="Id" Filter="Contains"
AllowCustomText="true" DataSourceID="LinqDataSourceStato">
</telerik:RadComboBox>
</td>
<td width="18" style="padding-left: 5px;">
<asp:ImageButton ID="imgClearStatus" runat="server" AlternateText="Clear selection"
ImageUrl="_LAYOUTS/IMAGES/Iacopo/eliminaOn.gif" OnClientClick="ImgClearClick(this.getAttribute('id'))"
Width="14" Height="14"/>
</td>
When I click on the ImageButton I want to clear the content of the ComboBox. Here following my javascript code:
function ImgClearClick(item) {
var combo = $find("<%= cmbStato.ClientID %>");
//combo.disable(); //WORKS!!
combo.SetText(''); //DOESN'T WORK
combo.ClearSelection(); //DOESN'T WORK
// var str = combo.GetValue(); //DOESN'T WORK
}
I also put commented tests I have done that were working or not. In particular the disable/enable funcions work properly.
Thanks in advance for any help you can give me.
Regards,
Dario Zanelli