RadDropDownList items.clear() is not working

2 posts, 0 answers
    HAN MING avatar
    5 posts
    Member since:
    Sep 2016

    Posted 05 Sep 2016 Link to this post


    I trying to do a rest of DropDownList whenever my RadTabStrip is changing. I have try using Items.Clear() when there a TabSwitch Event occur. however, is not wroking.The Item in DropdownList is blinded with Datasource, try setting DataSource as Null is not working too.

    Can someone advise my an alternative solution? 

  2. Ivan Danchev
    Ivan Danchev avatar
    1268 posts

    Posted 06 Sep 2016 Link to this post

    Hello Han Ming,

    You can clear the DropDownList on tab selection either on the client or on the server. In order to do it on the server subscribe the TabStrip to the TabClick event and call the DropDownList's Clear() method in its handler:
    protected void RadTabStrip1_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)

    On client you can use the OnClientTabSelecting event:
    function OnClientTabSelecting(sender, eventArgs) {
        var ddl =  $find("<%=RadDropDownList1.ClientID%>")
        ddl.get_textElement().innerHTML = "";

    If you are binding the DropDownList in the code behind, be sure you are not rebinding it after clearing its items, for example after the server-side TabClick fires.

    Ivan Danchev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top