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

RadComboBox selecteditem does not clear out

1 Answer 138 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
mabs
Top achievements
Rank 1
mabs asked on 25 Oct 2010, 09:07 AM
I have a radcombobox with EnableAutomaticLoadOnDemand="true", when I select the combobox, all the data loads and I am able to select an item.  If I then click the same combobox, the value of the previous selection is present, therefore it will not load in any of the data untill i delete the text in the combobox.  Is there away around this?  I would like to the text to be cleared out so everytime a user clicks on the box it will load all the values in?

I have set up the radcombobox in the folloaing way
<telerik:RadComboBox ID="rcb_1" AllowCustomText="true" runat="server" EmptyMessage="Please select a value..." 
DataTextField="description" DataValueField="ID" CssClass="radComboBox" AutoPostBack="true" MaxHeight="200px" width="170px"
EnableAutomaticLoadOnDemand="true" Filter="Contains" ></telerik:RadComboBox>
I bind the data in the following way,
rcb_1.DataSource = Class.getData()
rcb_1.DataBind()
Any help would be much appreciated

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 28 Oct 2010, 01:20 PM
Hi Russell Mabin,

The reason for this behavior is the Filter property. In order to work-around it, please subscribe to OnClientDropDownOpening event of the combobox and add the following javascript function to your page:

function dropDownOpening(sender, args) {
    if (sender.get_text() != "") {
        sender.set_text("");
        sender._filterText = "";
        sender.requestItems("");
    }    
}

please try it and let us know how it goes.

Regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
mabs
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or