This is a migrated thread and some comments may be shown as answers.
How to Clear the RadCombo
3 Answers 15 Views
This is a migrated thread and some comments may be shown as answers.
Kim
Top achievements
Rank 1
Kim asked on 24 Jul 2013, 04:13 AM
Hi,


I have a radcombo bound to an iList.

How to I "unbind"? 

I have tried datasource=nothing, but it shows bound members of my class in the combo as items. 

I have tried combo.items.clear and that does not work either. 

Please see attached image.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 24 Jul 2013, 07:49 AM
Hi Kim,

Please have a look into the following JavaScript code I tried to clear the RadComboBox.

JavaScript:
var RadComboBox1 = $find('<%=RadComboBox1.ClientID %>');
RadComboBox1.clearItems();

Thanks,
Shinu.
0
Kim
Top achievements
Rank 1
answered on 25 Jul 2013, 12:55 AM

Hi thanks for your reply. 

In VB.NET code behind is where i am having the problem.

Thanks.
0
Shinu
Top achievements
Rank 1
answered on 25 Jul 2013, 03:32 AM
Hi Kim,

Please have a look into the following code I tried.

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="Item 1" />
        <telerik:RadComboBoxItem runat="server" Text="Item 2" />
        <telerik:RadComboBoxItem runat="server" Text="Item 3" />
        <telerik:RadComboBoxItem runat="server" Text="Item 4" />
    </Items>
</telerik:RadComboBox>
<br />
<telerik:RadButton ID="RadButton1" runat="server" Text="Clear Items" OnClick="RadButton1_Click">
</telerik:RadButton>

VB:
Protected Sub RadButton1_Click(sender As Object, e As EventArgs)
    RadComboBox1.Items.Clear()
End Sub

Thanks,
Shinu.
Asked by
Kim
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Kim
Top achievements
Rank 1
Share this question
or