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

RadComboBox Grouping

3 Answers 59 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Moch Yusup
Top achievements
Rank 1
Moch Yusup asked on 27 Nov 2012, 05:55 AM
Hi There,

I'm working on a View containing several filter RadComboBox. My client wants me to clear other RadComboBoxs if user click on any item of the ComboBox. For example, there are 4 combo box (filter). If user select item 'A' on combo box 1, then combo box 2, 3 and 4 will be cleared.

That scenario actually is a 'no problem' one. But my client also wants if a user click "Clear selection" on a combo box (let say cb 1) then the other combo boxes (cb 2,3,4) also have to be cleared. This is when I stucked with the RadComboBox.

Firstly I thought that might be an event triggered when "Clear Selection" is clicked/selected that I can subscribe. But I found out that there is no such an event : http://www.telerik.com/community/forums/silverlight/combobox/clearselection-event.aspx

If only I can make group of combo box that connected together, and when I clear one of the combo box it will clear all the selection. I think there isn't a feature like this, but I wonder if there is one? If there isn't, I wonder if you can suggest me another solution to solve the problem? are there any possible telerik/windows 'dropdown like' element that I can use?

Thanks,
Moch Yusup

3 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 29 Nov 2012, 03:34 PM
Hi Moch,

The SelectionChanged event is triggered when the ClearSelectionButton is clicked. In that event you can listen if the SelectionChangedEventArgs e.AddedItems is equal to 0 and the e.RemovedItems is equal to 1, if that condition is true the ClearSelectionButton has been hit.

Hope this is helpful.

Greetings,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Moch Yusup
Top achievements
Rank 1
answered on 30 Nov 2012, 04:19 AM
Hi Vladi,

Thanks, but the SelectionChanged event wont be triggered when the selected item remain unchanged, will it?

So, I'm afraid it won't cover this scenario:
  1. User select 'A' from cb1 (cb 2, 3 and 4 will be cleared)
  2. User click "Clear Selection" on cb 3. (expected: cb 1, 2 and 4 will be cleared as well)

Since cb 3 is already clear (SelectedItem is null) and user clear it, the SelectedItem remains the same and SelectionChanged is not triggered. Is there any event(s) that triggered when "Clear Selection" is clicked, regardless the selection is changed or not?

Cheers,
Moch Yusup

0
Vladi
Telerik team
answered on 04 Dec 2012, 12:21 PM
Hello Moch,

The SelectionChanged event is triggered only when the selection has changed, in your case when there hasn't been any selection in the ComboBox and clicking on the Clear button will not cause the SelectionChanged event to be triggered which is the behavior of that event by design.

I am afraid but this is not a supported scenario in the control and there isn't a build in feature that would be useful in order to achieve the behavior you are trying to implement.

I would recommend you to add a command to the control and in that command clear the collections in your ViewModel, that should be a solution to your scenario but currently we can't provide you with an appropriate example of the described approach.

Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ComboBox
Asked by
Moch Yusup
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Moch Yusup
Top achievements
Rank 1
Share this question
or