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

Populate dropdown from web service

1 Answer 74 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
jayvr
Top achievements
Rank 1
jayvr asked on 17 May 2008, 10:12 PM
Hi Guys,
 
      I have 2 dropdowns in a radgrid that are displayed when the grid is in edit mode. Dropdown1 is populated with data and dropdown2 is disabled with one value, "Please select from dropdown1 first". When the user selects from dropdown1, I want to populate dropdown2 based on the dropdown1 selection. I have attached a server side OnIndexChange event to dropdown1 but on postback, the grid does not come back in edit mode. Is my best option to create a client event for dropdown1 that calls a webservice to populate dropdown2. If yes, do you have an example of how to populate a dropdown or a combo box using the webservice manager? What is the proper approach here?

Thanks,
Jayvr

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 19 May 2008, 11:41 AM
Hi jayvr,

I suggest you use advanced data-binding with your grid handling the NeedDataSource event. This event fires each time the grid needs to be bound and you will not need to bind the control each time the page is submitted. And this way on PostBack of the dropdown of your edit form the grid will stay in edit mode.

Please review our online demo here as well. Give this suggesting a try and let us know if you need further directions.

Best regards,
Iana
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
jayvr
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or