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

Cascading Combo's in FormView

3 Answers 181 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 14 Mar 2008, 05:01 AM
I need a little help here. I created a set of cascading RadComboBoxes that worked great.

Then I decided to change the way my page worked and wrapped everything in a asp:FormView control so I could easily bind the entire form.

The problem is that now the cascading RadComboBoxes don't work using the example in the demo. Originally, there was a call to a function that loaded the first dropdown in the Page_Load event. I can't do this anymore though because the FormView hasn't been created yet and the control to load doesn't exist.

I've tried moving the call to the function that loads the first drop-down to the FormView1_ItemCreated event which loads the first dropdown, but only after the RadComboBox is created and therefore it throws an error with the SelectedValue='<%# Bind("councils") %>' property since the datasource hasn't been created yet.

I can't seem to figure out the proper sequence of events to get this working. Do you guys have an example of cascading RadComboBoxes in a FormView or can you suggest a way to do it? Thanks!

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 18 Mar 2008, 10:03 AM
Hi Philip,

You could try binding the RadComboBox as shown in the following example: Combo In Grid.

I hope this helps.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Val
Top achievements
Rank 1
answered on 21 Jul 2008, 04:22 PM
Do you have an example with the combo in formview or grid with load on demand from web service?

I get the same error and I do not think is doable with the new combo. I was successfully using the "value" property of the old combo to bind in the form view ,Value='<%# Bind("councils") %>', but in the new version has been removed and I have to use SelectedValue.

In my case, I have combo with load on demand from web service in FormView and in ItemCreated event I prepopulate the combo with top 10 items starting with the current binding value so when it renders the control the selected value will be in the list. But when I run it it throws System.ArgumentOutOfRangeException: Selection out of range.

I tried all sorts of solutions but nothing works.
0
Simon
Telerik team
answered on 23 Jul 2008, 10:27 AM
Hi Val,

Please see this online example which shows one way of binding a ComboBox nested in Grid and this help article for another, different approach (you can assume that there is a RadComboBox instead of a MS DropDownList).

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Philip
Top achievements
Rank 1
Answers by
Simon
Telerik team
Val
Top achievements
Rank 1
Share this question
or