I have a textbox and radcombobox control on a page. The textbox is for zip codes and the radcombo should autocomplete the stores in a zip as i type in the combobox. When i type in some text in combobox it does not seem to take the text I passed in textbox control initially. But if i comeback and change the text in zip textbox (basically enter the same text again) it seems to populate the combobox as expected. Not sure if I a missing anything. Can someone help me with this please.
Thanks
Dilip
4 Answers, 1 is accepted
The provided information is not enough to reproduce the problem locally. Could you please paste your code here or ideally open a support ticket and send us sample running project to test it locally?
Regards,
Rosi
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Here is my aspx code for this part.
<tr>
<td style="width: 40%; height: 26px;">
<div class="pagecontentalt">Zip</div></td>
<td style=" height: 26px">
<asp:TextBox ID="txtZip" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 40%">
<div class="pagecontentalt">Stores</div></td>
<td>
<telerik1:RadComboBox ID="rdComboSCT" runat="server"
AllowCustomText="True" ShowToggleImage="False"
EnableLoadOnDemand="True"
OnItemsRequested="rdComboSCT_ItemsRequested"
Skin="Web20"
AutoPostBack="True" onselectedindexchanged="rdComboSCT_SelectedIndexChanged"
ShowWhileLoading="True">
</telerik1:RadComboBox></td>
</tr>
Hers is part of my code behind.
protected void rdComboSCT_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
RadComboBox comboBox = (RadComboBox)sender;
BindDataToSCTComboBox(e.Text, comboBox);
}
protected void BindDataToSCTComboBox(string text, RadComboBox comboBox)
{
DataTable dt = new DataTable();
dt =
new ProjDataHandler().GetItemsLikeForZipAsDataTable(text, txtZip.Text.Trim());
comboBox.Items.Clear();
foreach (DataRow row in dt.Rows)
{
RadComboBoxItem item = new RadComboBoxItem();
item.Text = row[
"Name"].ToString();
item.Value = row[
"Id"].ToString();
comboBox.Items.Add(item);
}
}
Thank you for the provided cove.
The reason for the problem is that ItemsRequested event is a result of a callback. And when it is executed the ViewState is not loaded yet.
I suggest you solve the problem by using the Context property of RadComboBox. Please follow the article for more details : Passing Context Information to the Server
Regards,
Rosi
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
