How to Clear the RadCombo

4 posts, 0 answers
  1. Kim
    Kim avatar
    23 posts
    Member since:
    Dec 2012

    Posted 23 Jul 2013 Link to this post

    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.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kim
    Kim avatar
    23 posts
    Member since:
    Dec 2012

    Posted 24 Jul 2013 Link to this post


    Hi thanks for your reply. 

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

    Thanks.
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jul 2013 Link to this post

    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.
Back to Top