1

I wrote the following code, based on telerik examples:

<telerik:RadComboBox ID="rcbPageSize"   
runat="Server"   
skin="Gray"  
AllowCustomText="true"  
Style="float:right; margin-left: 5px;"   
Width="60px" 
OnClientTextChange = "PageSizeChanged"
OnClientSelectedIndexChange =  "PageSizeChanged">

<Items>
    <telerik:RadComboBoxItem runat="Server" Text="10" Value="10" />
    <telerik:RadComboBoxItem runat="Server" Text="20" Value="20" Selected="true" />
    <telerik:RadComboBoxItem runat="Server" Text="50" Value="50" />
    <telerik:RadComboBoxItem runat="Server" Text="150" Value="150" />
    <telerik:RadComboBoxItem runat="Server" Text="250" Value="250" />
</Items>

</telerik:RadComboBox>


<telerik:RadCodeBlock ID="rcb" runat="server">

 <script type="text/javascript">

    function PageSizeChanged(sender, eventArgs) {

        alert("You typed " + sender.get_text());

    }

</script>
</telerik:RadCodeBlock>

When I change the selection, the function "PageSizeChanged" is called, but when I change the text by typing inside the combobox, the function is never called.

Anyone has a suggestion why? Thanks, Inbal.

Inbal
  • 909
  • 2
  • 28
  • 46

3 Answers3

1

I find it's definitely a 'feature' of this Telerik control. If you use your code, type something, press enter and then click outside the box the event will fire.

Just pressing enter or just clicking outside don't fire it on their own.

I'm using a slightly newer version of the Telerik controls as the skin Gray has been deprecated but I'm assuming it will be the same in your version.

David Bell
  • 86
  • 1
  • 7
0

OnClientTextChange WILL NOT fire until the user hits Enter or clicks outside the RadComboBox. Says so here: http://www.telerik.com/help/aspnet-ajax/combobox-onclienttextchange.html

Ann B. G.
  • 304
  • 2
  • 6
-1

You will have to set AutoPostBack="true", to fire server events.

<telerik:RadComboBox ID="rcbPageSize"  
AutoPostBack="true" 
runat="Server"   
skin="Gray"  
AllowCustomText="true"  
Style="float:right; margin-left: 5px;"   
Width="60px" 
OnClientTextChange = "PageSizeChanged"
OnClientSelectedIndexChange =  "PageSizeChanged">
Hristo
  • 859
  • 1
  • 8
  • 14
  • this is not a server side event , but client ! "onClientTextChange" – Mehdi Bugnard May 21 '15 at 12:01
  • Sorry, my bad. There is a typo in your code. The name of the event is OnClientSelectedIndexChanged not OnClientSelectedIndexChange and yes the OnClientTextChange will be fired after you press enter or click off the combo. Maybe you can use OnClientKeyPressing event it will be fired every time after you press a key – Hristo Jun 03 '15 at 12:00