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

[Solved] Please Help... cascading combobox-like behavior in Gridview control

4 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sunggoo Im
Top achievements
Rank 1
Sunggoo Im asked on 22 Feb 2010, 11:34 PM

Hello everyone,

I'm trying to implement something really close to cascading combobox, yet not exactly like it.

Here is the senario:
- two Griview columns (e.g. continent & country)
- columns are of combobox type (so that you can choose different options in edit-mode)
- when grid is loaded, two columns are filled according to the data source binded
- in edit-mode, second combobox (i.e. country) only displays countries within the continent selected in the first column
- changing selected item of the first combobox(i.e. continent) refreshes the second combobox with default country (or "choose country" item)

The application I'm trying to build is much more complex; however, I tried to truncate as much information as possible to write above senario which is basically what I'm having trouble with.

When I followed the way many cascading combobox example implemented, second combobox always pointed the the first-of-line country to be listed for that continent.

Please help anyone~ T-T

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 23 Feb 2010, 06:59 AM
Hi Sunggoo Im,

Please check this blog post for more info about similar technique:
http://blogs.telerik.com/pavelpavlov/posts/10-01-27/cascading_comboboxes_selection_in_radgridview_for_silverlight_and_wpf.aspx

Best wishes,
Vlad
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.
0
Sunggoo Im
Top achievements
Rank 1
answered on 23 Feb 2010, 04:30 PM

Hi Vlad,

Thanks for your comment, but it didn't solve my problem.

Pavel's solution demonstrates how to implement cascading comboboxes; however, the one that I’m trying to do needs to have pre-selected country and continent values selected in each column.

 

And at the end of each edit session, possible changes in country and continent comboboxes must be submitted back to the database.

 

Please advice me.

 

Thank you,

0
Marlos
Top achievements
Rank 1
answered on 02 Mar 2011, 03:50 PM

The solution used in

http://blogs.telerik.com/pavelpavlov/posts/10-01-27/cascading_comboboxes_selection_in_radgridview_for_silverlight_and_wpf.aspx

is very good and has helped me a lot, but how can I tell which is calling the combobox event?

No access to UniqueName Name and is always empty.

Thanks.
0
Yavor Georgiev
Telerik team
answered on 06 Mar 2011, 01:46 AM
Hello Marlos,

 You can find the column containing the RadComboBox that raised the event by calling the ParentOfType<GridViewCell>() extension method on it and checking the Column property of the returned GridViewCell object.

 Sunggoo,

 Perhaps what you want can be accomplished by setting the EmptyText property of the second RadComboBox to "Choose country" in the XAML template and then setting the Country property of the data item to null when the SelectionChanged of the first combo box changes.

 Also, depending on how you get data from the database, it's up to you to write the code that will communicate the changes to the business objects the RadGridView is bound to back to the database.

Best wishes,
Yavor Georgiev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Sunggoo Im
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Sunggoo Im
Top achievements
Rank 1
Marlos
Top achievements
Rank 1
Yavor Georgiev
Telerik team
Share this question
or