AutoPostBack? why? I don't want to post back. I want to capture the event on the client side. Anyway I tried it and it doesn't change a thing.
Here is the script in the page.
function testEvent(sender, eventArgs) {
var combo = $find('Customer');
alert(combo.get_value() + " : " + combo.get_text());
}
Here is the control definition:
<telerik:RadComboBox ID="Customer" runat="server" Width="200px" DropDownWidth="405px" Height="225" OnClientSelectedIndexChanged="testEvent" HighlightTemplatedItems="true" ExpandAnimation-Duration="0" CollapseAnimation-Duration="0" EnableLoadOnDemand="true" EnableEmbeddedSkins="false" Skin="Vista">
<ItemTemplate>
<span style="width:50;overflow:hidden;white-space:nowrap;">
<%#DataBinder.Eval(Container.DataItem, "ID")%>
</span>
<span style="width:164;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:4;">
<%#DataBinder.Eval(Container.DataItem, "LastFirstName")%>
</span>
<span style="width:164;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-left:4;">
<%#DataBinder.Eval(Container.DataItem, "Address")%>
</span>
</ItemTemplate>
</telerik:RadComboBox>
and the code behind:
Protected Sub Customer_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles Customer.ItemsRequested
Dim strPrefixText As String = e.Text.Trim
If strPrefixText <> Nothing Then
With Me.Customer
.DataSource = DAL.GetReader(String.Format(
"SELECT Top 100 ID, LastFirstName, Address " &
"FROM CustomersView WHERE LastFirstName LIKE '{0}%' ORDER BY LastFirstName", DBQuoteFix(strPrefixText)))
.DataValueField = "ID"
.DataTextField = "LastFirstName"
.DataBind()
.DataSource.Close()
End With
End If
End Sub
How to reproduce the problem:
- Select an item from the list.
- Item gets selected and event is raised normally
- Now go to the end of the text and delete a few characters so that text no longer matches any items in the list
- No event is raised even though the client value and posted ID value has changed to blank