ComboBox with LoadOnDemand clearselection() not working...

2 posts, 0 answers
  1. Sergiu
    Sergiu avatar
    16 posts
    Member since:
    Jun 2012

    Posted 10 Aug 2010 Link to this post

    Hey guys,

    I am using LoadOnDemand throughout this app in all my RadComboBox instances... Here is an example...

     

    <telerik:RadComboBox ID="rcProject" Runat="server" AllowCustomText="false"

     

     

     

    AutoPostBack="True" EmptyMessage="Type a Project Name"

     

     

     

    EnableLoadOnDemand="True" EnableVirtualScrolling="True" Filter="StartsWith"

     

     

     

    Height="22px" MaxHeight="200px" OnItemsRequested="rcProject_ItemsRequested"

     

     

     

    ShowMoreResultsBox="true"

     

     

     

    ToolTip="You can type or scroll and select. What you type, must exist in the list"

     

     

     

    Width="200px">

     

     

     

    </telerik:RadComboBox>

     

     


    My issue is that once a value is selected in this combobox, once the user clicks on the combobox to select another item... the previously selected item is the only thing showing up in the list... because of the item selected is a match...

    I have tried to clear the text, value of the combobox in the rcProject_ItemsRequested event handler but not able to get it to clear... The text is still there. Could you help me with a client side workaround? I have seen some other posts but unable to implement anything, I keep getting Object is null...

    Thanks much,

    Sergiu Pascutiu
  2. Sergiu
    Sergiu avatar
    16 posts
    Member since:
    Jun 2012

    Posted 10 Aug 2010 Link to this post

    Ah figured it out...

    This seems to work!

                  function ClearSelectedItem(sender) {
                    if (sender._value != "") {
                        sender.set_text("");
                        sender.commitChanges();
                    }
                }

    then, on the Combo Box...

    OnClientDropDownOpening="ClearSelectedItem"

Back to Top