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

Client API for Setting Value to ComboBox

1 Answer 46 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 15 Jun 2015, 12:01 PM

Hi,

 

In My Application I have Cascading combo box, User is selecting one combo box and based on selection of first combo box second combo box  will get populated,  now I am storing those values to database and I want to set the value of combo box from Java script to allow user to update those values. To do so how can I set the text of combo box having LoadOnDemand from javascript. e.g. My combobox will have the items as

Employee ID    EmployeeName

1                          ABC

2                          PQR

now I am getting PQR from database and I want to set it to Combo box having PopulateOnDemand Property = true. I tried to create the object of Combobox in JavaScript and then tried with FindItemByText property, but since combo box is configured to Load on demand it is not able to find anything and not able to set the value.

Please let me know how to do it using JavaScript.

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 18 Jun 2015, 07:04 AM
Hello Rahui,

Indeed the RadComboBoxItems collection is not accessible at server-side, but it is at client-side. You can use the findItemByText() at client-side and set the item as selected:

$find("RadComboBox1").findItemByText("PQR").select()


Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Rahul
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or