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

how to manage two combobox if the items source of one depends on the other ?

3 Answers 46 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
ajoua taha
Top achievements
Rank 1
ajoua taha asked on 04 May 2016, 06:45 PM

Hi,

I have a DataForm in which there are two DataFormComboBoxField, one for the governorate and one for the delegation, and when I select a governorate in the first combo box, the ItemSource the 2nd combobox should contain the list of delagations that  belongs to the selected governorate.

Thanks.

3 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 09 May 2016, 05:05 PM
Hello,

I prepared a sample project that illustrates how to achieve this behavior. You can find it attached to my post.

Regards,
Ivan Ivanov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
ajoua taha
Top achievements
Rank 1
answered on 10 May 2016, 09:39 AM

hi Ivan,

Thank you for your reply, it was very beneficial, but is there a possibility to do things in view model instead of codebehind.

thank you

0
Ivan Ivanov
Telerik team
answered on 13 May 2016, 08:33 AM
Hi,

The suggested approach is purely event driven and it won't be easy to translate the event handlers to ViewModel commands, as class level event handler is used to process RadComboBox.SelectionChangedEvent occurrences. However, you can still remove this code from the view's code behind, by wrapping the logic in an attached behavior class.

Regards,
Ivan Ivanov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
DataForm
Asked by
ajoua taha
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
ajoua taha
Top achievements
Rank 1
Share this question
or