I'm having a problem using Telerik's javascript API RadComboBox. And no, I have no way to switch from Telerik to jQuery or to another framework. Suffice it to say that I have almost no hair left on my head: P
In a nutshell, I want to capture the selected index of one RadComboBox and update another RadComboBox to this index. For example. selecting a value in the first RCB automatically updates the second on the client side. My problem is that I cannot find a way to set the index in the second RCB, although the docs say there is an easy way to do this .. (you heard that one is in front of the right one :)
I followed the API docs on this page ( telerik docs ) and also used the javascript debugger in IE8 and the excellent FireBug in Firefox. I am using the build version of Telerik.Web.UI 2009.2.826.20
I do not need a complete source for a solution, but a push in the right direction would be greatly appreciated! :)
Here is an example of the code I prepared together:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<script type="text/javascript" language="javascript">
function masterChanged(item)
{
var detailCB = <%= DetailCB.ClientID %>;
var index = item.get_selectedIndex();
detailCB.SetSelected(index); //method does not exist, but should according to the docs..
}
</script>
<div>
<telerik:RadComboBox ID="MasterCB" runat="server" OnClientSelectedIndexChanged="masterChanged">
<Items>
<telerik:RadComboBoxItem Text="One" Value="1" runat="server" />
<telerik:RadComboBoxItem Text="Two" Value="2" runat="server" />
<telerik:RadComboBoxItem Text="Three" Value="3" runat="server" />
</Items>
</telerik:RadComboBox>
</div>
<div>
<telerik:RadComboBox ID="DetailCB" runat="server">
<Items>
<telerik:RadComboBoxItem Text="One" Value="1" runat="server" />
<telerik:RadComboBoxItem Text="Two" Value="2" runat="server" />
<telerik:RadComboBoxItem Text="Three" Value="3" runat="server" />
</Items>
</telerik:RadComboBox>
</div>
</form>
I do not need a complete source for a solution, but a blow in the right direction would be greatly appreciated! :)
source
share