ComboBox with LoadOnDemand clearselection() not working...

4 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"

  3. Kiran
    Kiran  avatar
    40 posts
    Member since:
    Oct 2018

    Posted 07 Jun Link to this post

    Hi,

    Same problem here. I was looking for an easier way to get rid of selection. Why should laod on demand behave any differently when clearselection()? 

  4. Kiran
    Kiran  avatar
    40 posts
    Member since:
    Oct 2018

    Posted 07 Jun Link to this post

    Hi,

    The solution is just as simple as below. For regular radcomboboxes clearsolution would suffice but when loadondemand is used below did the trick for me.

    radcombobox1.text = ""

    radcombobox1.clearselection()

Back to Top