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

[Solved] Cascading GridDropDownColumns

1 Answer 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 12 Feb 2010, 10:59 AM
I have a couple of grids that I need to do this on, each grid has 3 or 4 GridDropDownColumns - i'm not sure the best way to implement this.

I understand that each GridDropDownColumn will receive it's items list from (in my case) an ObjectDataSource, so as I move from the 1st dropdown to the 2nd,  the 2nd dropdown needs to be passed the value of he 1st dropdown so it can re-evaluate it's list and rebind .. and so the pattern flows along the columns.

My ObjectDataSource will have a custom SelectMethod,  so I guess my questions are:
  1. How do I pass into the SelectMethod of the 2nd columns ObjectDataSource the value that was selected from the 1st columns DropDown?
  2. Once i'm in the SelectMethod of the 2nd column and i've received the value of the 1st columns dropdown,  how do I force the 2nd column to re-evaluate it's ObjectDataSource  -- from what I can tell the data is bound upfront as the grid item goes into edit mode; so I would need to trigger on value change of the 1st drop down that the 2nd drop-down needs to re-evaluate it's selection list.
  3. Do you have any simple examples of this cascading effect inside a grid?  I've seen examples of cascading behavour but not inside a grid.

Thankyou
Brian.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 17 Feb 2010, 12:55 PM
Hi Brian,

For scenarios like this, it is advisable to use a GridTemplateColumn with a RadComboBox in the EditItemTemplate. This will give you greatest flexibility in terms of binding the combos and cascading them.

A sample project is attached, demonstrating what I have in mind. I use GridTemplateColumn with RadComboBox controls in the EditItemTemplate. In RadGrid's ItemDataBound event, I bind the first combobox in the cascading line. The second RadComboBox is databound in the SelectedIndexChangedevent handler of the first combo, having the selected value of the first combo. Similarly, the third combo is databound in the SelectedIndexChanged event handler of the second combo.

Regards,
Veli
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Brian
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or