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

RadCombobox ItemsRequested

1 Answer 282 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Minh
Top achievements
Rank 1
Minh asked on 08 Sep 2011, 04:45 AM
Hi,

I'm using the RadCombox ItemsRequested to perform partial search....this feature works fine. However, during the update, the RadCombobox.text is already prepopulated. This causes the dropdown to be blank (view the error.jpg). Is there anyway to specify that once the user clicks on the RadCombox dropdown, the selected value disappears and the full dropdown list appears? 

 

 

//Populate the Area dropdown

 

 

 

protected void RadComboBoxArea_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)

 

{

 

 

RadComboBox comboBox = (RadComboBox)sender;

 

 

 

// Clear the default Item that has been re-created from ViewState at this point.

 

comboBox.Items.Clear();

 

 

 

BindingList<LookupArea> Area = WellVentDataLayer.GetAreas(e.Text);

 

 

 

foreach (LookupArea i in Area)

 

{

comboBox.Items.Add(

 

new RadComboBoxItem(i._AreaName.ToString(), i._ID.ToString()));

 

}

comboBox.DataBind();

}

1 Answer, 1 is accepted

Sort by
0
Accepted
Kalina
Telerik team
answered on 13 Sep 2011, 09:52 AM
Hi Minh,

The behaviour that you describe is correct and is by design.

When there is a selected item in RadComboBox that uses Load On Demand - only this item will be listed in control dropdown. If user deletes the text in the input - all items will be listed again.
You can observe this behaviour at this online demo (take a look at the "Supplier" combo).

If you want to change this default behaviour – you can try handling the OnClientDropDownOpening event in this manner:
<script type="text/javascript">
 
    function OnClientDropDownOpeningHandler(sender, eventArgs) {
            sender.requestItems("", false);
    }
     
</script>


All the best,
Kalina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Minh
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or