This is a migrated thread and some comments may be shown as answers.

ComboBox with LoadOnDemand clearselection() not working...

3 Answers 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sergiu
Top achievements
Rank 2
Sergiu asked on 10 Aug 2010, 06:57 PM
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

3 Answers, 1 is accepted

Sort by
0
Sergiu
Top achievements
Rank 2
answered on 10 Aug 2010, 10:07 PM
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"

0
Kiran
Top achievements
Rank 2
answered on 07 Jun 2019, 02:36 PM

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()? 

0
Kiran
Top achievements
Rank 2
answered on 07 Jun 2019, 02:40 PM

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()

Tags
ComboBox
Asked by
Sergiu
Top achievements
Rank 2
Answers by
Sergiu
Top achievements
Rank 2
Kiran
Top achievements
Rank 2
Share this question
or