RadComboBox Grouping

4 posts, 0 answers
  1. Moch Yusup
    Moch Yusup avatar
    5 posts
    Member since:
    Nov 2011

    Posted 26 Nov 2012 Link to this post

    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
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 29 Nov 2012 Link to this post

    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.

  3. DevCraft banner
  4. Moch Yusup
    Moch Yusup avatar
    5 posts
    Member since:
    Nov 2011

    Posted 29 Nov 2012 Link to this post

    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

  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 04 Dec 2012 Link to this post

    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.

Back to Top