This is a migrated thread and some comments may be shown as answers.

[Solved] Arguments are null when OnClientSelectedIndexChanged is raised

2 Answers 136 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Pooya
Top achievements
Rank 1
Pooya asked on 26 Jun 2009, 09:14 AM
I used the codes written here for OnClientSelectedIndexChanged: http://www.telerik.com/help/aspnet-ajax/combo_clientsideonclientselectedindexchanged.html

The event is raised when an item selection is changed but the parameters are not passed.

eventArgs is null inside the function and sender just has Text and Value properties.

Any help is much appreciated.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Jun 2009, 10:04 AM
Hello,

I tried the same code and it is working fine in my end. Have a look at the code that I tried (with ASP.NET AJAX version 2009.01.0311.35).

ASPX:
 
<telerik:RadComboBox ID="RadComboBox2" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"
    <Items> 
        <telerik:RadComboBoxItem Text="Item1" /> 
        <telerik:RadComboBoxItem Text="Item2" /> 
    </Items> 
</telerik:RadComboBox> 

JavaScript:
 
<script type="text/javascript"
function OnClientSelectedIndexChanged(sender, eventArgs) 
 var item = eventArgs.get_item(); 
 sender.set_text("You selected " + item.get_text()); 
</script> 

I guess you are using ASP.NET version of RadControl (not the AJAX version). In ASP.NET version "OnClientSelectedIndexChanged" receives only single parameter which is the newly selected item. If you are using ASP.NET version of RadControls, then follow the documentation below.
OnClientSelectedIndexChanged

Feel free to share the comments,

-Shinu
0
Pooya
Top achievements
Rank 1
answered on 26 Jun 2009, 10:16 AM
Thanks mate.

I think you're right; my assembly name is RadComboBox.Net2.dll which should be the asp.net version.

In which assembly is the ASP.NET AJAX ComboBox?

Thanks.
Tags
ComboBox
Asked by
Pooya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pooya
Top achievements
Rank 1
Share this question
or