Hi all,
I have a radCombobox that I'm loading with data on the ItemsRequested method. I'm using a stored procedure to grab data that is "%like%" the text the user types in. This works great...until what they have typed no longer returns any records. Once this is the case, no matter what they do, backspace, exit the control and return, the control stops executing the ItemsRequested method. There is no postback, no attempt to run the method on the server side.
I'm including the code of my combobox and my ItemsRequested method.
So, can anyone help with this?
Thanks,
Joshua Wise
HTML Script:
| <telerik:RadComboBox runat="server" ID="radAccount" DropDownWidth="400px" EnableVirtualScrolling="True" |
| Height="150px" AllowCustomText="true" MarkFirstMatch="true" |
| Skin="WebBlue" OnItemsRequested="radAccount_ItemsRequested" OnSelectedIndexChanged="radAccount_SelectedIndexChanged" |
| EnableLoadOnDemand="true" OnTextChanged="radAccount_TextChanged" |
| AutoPostBack="True"> |
| <ItemTemplate> |
| <table class="ComboBoxTable"> |
| <tr> |
| <td class="LeftCellComboBox"> |
| <%# DataBinder.Eval(Container, "Attributes['acctcat']")%> |
| </td> |
| <td class="LeftCellComboBox"> |
| <%# DataBinder.Eval(Container, "Attributes['Description']")%> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| <CollapseAnimation Type="OutQuint" Duration="1"></CollapseAnimation> |
| </telerik:RadComboBox> |
Server Side C# Code
| protected void radAccount_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) |
| { |
| DataRow[] data = GetData(e.Text); |
| e.EndOfItems = endOffset == data.Count(); |
| radAccount.Items.Clear(); |
| for (int i = 0; i < data.Count(); i++) |
| { |
| RadComboBoxItem item = new RadComboBoxItem(); |
| item.Text = (string)data[i]["acctcat"]; |
| item.Value = data[i]["acctcat"].ToString(); |
| item.Attributes.Add("acctcat", data[i]["acctcat"].ToString()); |
| item.Attributes.Add("Description", data[i]["Description"].ToString()); |
| radAccount.Items.Add(item); |
| item.DataBind(); |
| } |
| //e.Message = GetStatusMessage(endOffset, data.Rows.Count); |
| } |
In this I get an array of DataRows which I then add attributes to for the control.