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

Multiple ComboBoxes in RadGrid

1 Answer 90 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Chris T.
Top achievements
Rank 1
Chris T. asked on 30 Jan 2009, 08:19 PM
We're trying to put the old classic multiple dependent combo box scenario into a RadGrid edit template, and not having much luck.

The scenario is thus: combobox 1 (fldCategory) determines the contents of the list in combobox 2 (fldValue).  We've got the requestItems and such working, and fldValue shows the correct list, loaded whenever fldCategory changes.  Sounds like we're done, right?
There are two issues: 
1) When the user click edit, the selected item in fldValue isn't accurate, despite having ...
fldValue.SelectedValue = ((cTestRecord)e.Item.DataItem).AValue.ToString(); 
... in the ItemCreated.

2) When the user edits a row and selects a new Category, even though the list in fldValue is changed, and the user picks one of them, when the UpdateCommand fires, the SelectedValue of fldValue is NOT what they picked.  It seems to be the first item in whatever list was loaded when the user hits edit.  It is as if whatever happens to fldValue after selecting a new Category is ignored.

To see this, run the project, then click Edit on the first row (2, 5).  Pull down the "Category" combo and select "Type 3".  In the "Value" combo select "T3, Value 3" and click "Save".  This should give the row the value (3, 9).  Instead, it will be (3, 4), with 4 being the initially selected Type 2 value.  No matter what you select for Value, it will always be 4.

Does the combobox not realize it has been rebound?  When the UpdateCommand happens, there shouldn't even be an item with the value 4 in the list.

BTW: Insert seems to work just fine.  Huh.

Thanks for any insight anyone can provide into this strangeness.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 03 Feb 2009, 09:02 AM
Hello Chris,

Please set EnableLoadOnDemand property of the second RadComboBox with ID="fldValue" to true and you'll be able to get the selectedValue.

Greetings,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Chris T.
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or