I have a RadComboBox I am using ItemsRequested to populate the combobox with data that is filtered by the contents of another asp:TextBox control. So it is something like this:
The problem is that txtFilter.Text in the ItemsRequested event is only read the first time. After I delete the text from the RadComboBox, then change the text in txtFilter, then click the arrow on the combobox again, the results it shows me are from the original value of txtFilter.Text, not the newly changed value. How can I get around this? I need the combobox to always show a list of results that match the current value of txtFilter.Text.
thanks!
Brandon
<
asp:TextBox
runat
=
"server"
id
=
"txtFilter"
/>
<
telerik:RadComboBox
runat
=
"server"
ID
=
"rcbPCN"
AllowCustomText
=
"true"
EnableLoadOnDemand
=
"true"
OnItemsRequested
=
"rcbPCN_ItemsRequested"
AutoPostBack
=
"True"
CausesValidation
=
"False"
onselectedindexchanged
=
"rcbPCN_SelectedIndexChanged"
Filter
=
"StartsWith"
/>
.... code behind:
protected void rcbPCN_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
var query = PlanManager.QueryPlans().Where(q => q.bin == txtFilter.Text);
rcbPCN.DataSource = query;
rcbPCN.DataBind();
}
The problem is that txtFilter.Text in the ItemsRequested event is only read the first time. After I delete the text from the RadComboBox, then change the text in txtFilter, then click the arrow on the combobox again, the results it shows me are from the original value of txtFilter.Text, not the newly changed value. How can I get around this? I need the combobox to always show a list of results that match the current value of txtFilter.Text.
thanks!
Brandon