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

[Solved] Moving the selected item of one Rad combo box to another using Java script.

2 Answers 193 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Karthick Purushothaman
Top achievements
Rank 1
Karthick Purushothaman asked on 10 Jun 2009, 12:27 PM
Hi,


Can any one tell me how to move the selected item of one Rad combo box to another combo box using java script.

For ex: i have two Rad combo box which populate the "Country Name". When i select any country in the first combo box, on the selection of the check box that selected item need to move to the second combo box selected item using the javascript.  

I  am able to get the value but unable to make that as the second combo box  selected one.

Thanks & Regards,
Sushanth Mathew.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Jun 2009, 01:03 PM
Hi Karthick,

I guess you are able to get the selected value from first combobox. Try the client side code for setting the item as selected one in second RadComboBox.

ASPX:
 
<telerik:RadComboBox ID="RadComboBox2" runat="server"
    <Items> 
        <telerik:RadComboBoxItem runat="server" Text="Autralia" Value="Autralia"></telerik:RadComboBoxItem> 
        <telerik:RadComboBoxItem runat="server" Text="China" Value="China"></telerik:RadComboBoxItem> 
        <telerik:RadComboBoxItem runat="server" Text="England" Value="England"></telerik:RadComboBoxItem> 
    </Items> 
</telerik:RadComboBox> 

JavaScript:
 
<script type="text/javascript"
function setSelected() 
    var combo = $find("<%= RadComboBox2.ClientID %>"); 
    var text = "England";  // Give the selected value of first combobox 
    var item = combo.findItemByText(text); 
    item.select(); 
</script> 

Thanks,
Shinu.
0
Karthick Purushothaman
Top achievements
Rank 1
answered on 10 Jun 2009, 01:57 PM
Hi,

My Issue in the Rad combo box  with the java script is solved.

Thank you,

Regards,
Sushanth Mathew
 
Tags
ComboBox
Asked by
Karthick Purushothaman
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Karthick Purushothaman
Top achievements
Rank 1
Share this question
or