Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > MultiSelect option in Combo Box

Not answered MultiSelect option in Combo Box

Feed from this thread
  • Varun Mangla avatar

    Posted on Oct 9, 2009 (permalink)

    Hi,

    How can I incorporate multi select option in Combo Box?

    Thanks,

    Varun

    Reply

  • Valeri Hristov Valeri Hristov admin's avatar

    Posted on Oct 16, 2009 (permalink)

    Hello Varun,

    RadComboBox for Silverlight (and WPF) does not support multiple selection out of the box. Find attached a simple example that demonstrates one of the simplest ways to implement it.

    Regards,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Attached files

    Reply

  • Varun Mangla avatar

    Posted on Oct 19, 2009 (permalink)

    Hello Valeri Hristov,

    Thanks for the application you sent me.

    There's one more facility I want to have in MultiSelect Combo Box. If the user clicks the first option all other options get clicked automatically.

    I have been struggling with that too. How can I do it?

    Thanks a lot for help.

    Varun

    Reply

  • Varun Mangla avatar

    Posted on Oct 20, 2009 (permalink)

    I have figured out the solution to my last question.

    Thank you very much. The application you sent was of great help.

    Regards

    Varun

    Reply

  • Mitch Thraves avatar

    Posted on Dec 9, 2009 (permalink)

    Hi

    Do you have an example of your checkablecombobox.zip also available in vb.net? (WPF if possible!)

    Regards

    Mitch

    Reply

  • Daniel Schuessler avatar

    Posted on Apr 15, 2010 (permalink)

    I've implemented your solution and it works very well except for one thing; the only time that using the spacebar to check off a selection works is if the user mouse selects the item first.  Also keyboard navigation tends to skip selected items.  Is there a way to ensure that if the user uses the keyboard that they can press the spacebar (normal checkbox behaviour) to toggle the checkmark of a selection.?


    Reply

  • Valeri Hristov Valeri Hristov admin's avatar

    Posted on Apr 22, 2010 (permalink)

    Hello Daniel,

    You could try setting IsTextSearchEnabled=false on RadComboBox - this will prevent the control from handling the KeyDown event when Space is pressed.

    All the best,
    Valeri Hristov
    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.

    Reply

  • Wolfgang Kaiser avatar

    Posted on Apr 27, 2010 (permalink)

    I tried the example using 2010 Q1 and get this error:

    The attribute RadComboBox.SelectionBoxItemTemplate is read only and cannot be set. [Line: 30 Position: 19]
    just before getting a runtime error.

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Apr 28, 2010 (permalink)

    Hello Wolfgang,

    Since Q1 2010 version of the controls the property SelectionBoxItemTemplate is renamed to SelectionBoxTemplate. Please rename it in the project and the error will disappear.

    If you have any other questions let us know.

    Kind regards,
    Konstantina
    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.

    Reply

  • Rocky Fernandes avatar

    Posted on Jun 29, 2010 (permalink)

    Updating SelectionBoxItemTemplate is renamed to SelectionBoxTemplate works.. Thanks

    Reply

  • Justin Wilson avatar

    Posted on Aug 10, 2010 (permalink)

    Do you think there is any way to use the autocomplete functionality with this modified combo box?  I can't seem to get it to work.  I have a very long list and they need the ability to select multiple items.  I don't want them to have to scroll through the whole list to find something.  Any ideas would be helpful.

    Thanks,

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Aug 11, 2010 (permalink)

    Hi Justin Wilson,

    Thank you for your question.

    For more information about autocomplete option you can refer to this help article.
    What difficulties do you experience with the ComboBox? Could you please send us some sample code of your ComboBox?

    Looking forward to your reply.

    Sincerely yours,
    Konstantina
    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

    Reply

  • Justin Wilson avatar

    Posted on Aug 11, 2010 (permalink)

    I am using the code sample you provided above.  I have just been playing with the combo box properties and seeing what i can do.  If I use the control just as you have it I have not problem.  I have a couple of issues. 

    1.  It only accepts an object of type DataItem.  I am looking to create a generic control I can reuse with different objects in different pages.

    2.  When I set IsEditable to True and IsTextSearchEnabled to True the autocomplete doesn't really work.  I understand why it wouldn't but I was wondering if you have any other suggestions or ideas.

    Ultimately my problem is I have a couple places that need a clean interface to search a large list and select multiple options.  The ComboBox is very close to what I need.  If I didn't need to multiselect it would be perfect.  The MultiCombo box you provided is also close.  It can do the multil selection but only takes one type (DataItem) and eliminates some of the other features of the Telerik Combo box.  Let me know what you think.  Thanks for all your help.

    FYI I am using SilverLight 4 in VS 2010 and Telerik Q1 2010 SP2.

    <telerikInput:RadComboBox VerticalAlignment="Top" Width="200" IsEditable="True" CanAutocompleteSelectItems="True"
        ItemsSource="{Binding DataItems, Source={StaticResource DataViewModel}}" IsTextSearchEnabled="True">

       <telerikInput:RadComboBox.ItemTemplate>
        <DataTemplate>
         <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" Content="{Binding Text}" />
        </DataTemplate>
       </telerikInput:RadComboBox.ItemTemplate>

       <telerikInput:RadComboBox.SelectionBoxTemplate>
        <DataTemplate>
         <TextBlock
           Text="{Binding Owner.CheckedItems, Converter={StaticResource ValueConverter}}" />
        </DataTemplate>
       </telerikInput:RadComboBox.SelectionBoxTemplate>

      </telerikInput:RadComboBox>

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Aug 16, 2010 (permalink)

    Hi Justin,

    Thank you for your question.

    You can use every object for an Item of the ComboBox, the DataItem is just for example. You can create Checkable interface, which will inherit INotifyPropertyChanged interface. This new interface should have IsChecked property. The collection of the Items should implement this ICheckable interface. When you set the TextSearch.TextPath property of the ComboBox the Autocomplete will be enabled.
    Please find attached a sample project which illustrates the above mentioned approach.

    If you need further help please let us know.

    Regards,
    Konstantina
    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
    Attached files

    Reply

  • piyush avatar

    Posted on Aug 17, 2010 (permalink)

    Hi

    I am using above code to show checkable combobox. But it seems like this code is not working when we change the itemsource of combobox. Actually when I change the itemsource of combobox  SelectionBoxTemplate is not showing any text when any checkbox is checked. However instead of clicking checkbox if I click on empty area in an item(i.e.  the white area after checkbox text ) and then check/uncheck checkbox ,everything works fine. Can anybody help me in this ?

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Aug 18, 2010 (permalink)

    Hello piyush,

    There shouldn't be any problems with the solution when changing the ItemsSource. Could you please send us your project. In that way we will be able to track down the source of the issue and provide you with solution.

    Looking forward to your reply.

    All the best,
    Konstantina
    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

    Reply

  • piyush avatar

    Posted on Aug 19, 2010 (permalink)

    Hey

    In your solution just change the datasource of checkable combobox twice. For example open your solution and add a button or dropdown and add a click handler for that . In the handler change the itemsource of checkable combobox and then see whether results are expected. I used ur solution and did this thing. After change itemsource things are not working as expected

    Reply

  • Thiru avatar

    Posted on Aug 23, 2010 (permalink)

    SelectionBoxTemplate is binding data very first time when the control is loading, for next time when property changes or selection is changes this template is not binding the selected data in box.

    Reply

  • Trent Jones avatar

    Posted on Aug 23, 2010 (permalink)

    We are also facing the exact same issue with the selection.  Please advise.

    Reply

  • Konstantina Konstantina admin's avatar

    Posted on Aug 24, 2010 (permalink)

    Hi guys,

    Straight to the question:

    To make it work you will have to set the SelectedItem property of the RadComboBox. In that way the SelectionBoxTemplate will apply and it will work correctly. Every time the ItemsSource is changed the SelectedItem have to be set.

    Hope this helps. If you need further help please let us know.

    Regards,
    Konstantina
    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

    Reply

  • Kakone avatar

    Posted on Sep 30, 2010 (permalink)

    Hi,

    If you are interested, I did my own MultiSelect combobox with SelectedItems and SelectedValues properties directly on the ComboBox, you can test it here :
    http://www.telerik.com/community/code-library/silverlight/general/a-multiselect-combobox.aspx

    Cordially,
    Kakone

    Reply

  • Posted on Dec 22, 2010 (permalink)

    Hi Kakone,

    I've added my basic solution with a select all feature on your thread.
    I hope you don't mind.

    regards,
    Biruh.

    Reply

  • Veda avatar

    Posted on Jul 1, 2011 (permalink)

    Hi,
    Below is the code i have written for multiple selection of items in rabcombobox.
      <telerikInput:RadComboBox Height="20" Margin ="3,0,3,0"  Grid.Column="6"  Width="150" ItemsSource="{Binding GensetParameter, Mode=TwoWay}" >
                                    <telerikInput:RadComboBox.ItemTemplate>
                                        <DataTemplate>
                                            <CheckBox ClickMode="Press">
                                                <CheckBox.Content>
                                                    <TextBlock Text="{Binding parameterName, Mode=TwoWay}"/>
                                                </CheckBox.Content>
                                            </CheckBox>
                                        </DataTemplate>
                                    </telerikInput:RadComboBox.ItemTemplate>
                                </telerikInput:RadComboBox>


    Can you please help me how to get the multiple items selected to the viewmodel?

    Reply

  • Kevin avatar

    Posted on Jan 24, 2012 (permalink)

    I'm using this code @ the moment in wpf/MVVM.

    How can I bind the text value of the combobox for every item I check an item to a property within my viewmodel?

    Kevin

    Reply

  • M STOLYAR avatar

    Posted on Feb 2, 2012 (permalink)

    Hello, Telerik Team!

    I have a question about how to better incorporate SelectAll functionality inside RadComboBox.
    I've implemented basic solution when some checkbox outside RadComboBox is binded to IsAllSelected property of DataItems property of ViewModel and I'm trying to implement the same inside RadComboBox, when the first item of popup items is doing select/unselect all.

    When SelectAll checkbox is outside RadComboBox everything is simple:
    <CheckBox Content="(Select All)"
              DataContext="{StaticResource DataViewModel}"
              IsChecked="{Binding DataItems.IsAllSelected, Mode=TwoWay}"
              HorizontalAlignment="Center"/>


    public class CheckableCollection : ObservableCollection<ICheckable> {
        ...
            public bool IsAllSelected {
                get { return this.All(item => item.IsChecked); }
                set {
                    foreach (var item in this)
                        item.IsChecked = value;
                }
            }
    }


    But when I'm trying to implement within RadComboBox I cannot use default item template:
    <DataTemplate x:Key="DataItemCheckBoxTemplate">
        <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}"
                  Content="{Binding Text}" />
    </DataTemplate>
    because SelectAll checkbox must binded to IsAllSelected property, not IsChecked. But this solvable by ItemTemplateSelector and item template for select all item will be:
    <DataTemplate x:Key="AllOptionCheckBoxTemplate">
        <CheckBox IsChecked="{Binding IsAllSelected, Mode=TwoWay}"
                  Content="{Binding Text}" />
    </DataTemplate>

    I this case I must to explicitly add in data items collection the first "select all" fictionale item with some property which sill allow to distinct it from another data items in ItemTemplateSelector.
    But first problem is that when we binding to IsChecked property we binding to property of data item, but when to IsAllSelected we must bind to property of collection of data items.
    The second problem is this is not looking as a decent approach.
    Maybe you may advise some better one?

    This code is based on "checkablecombo-2.zip" solution from this thread.

    Sorry for my English.
    All the best!

    Reply

  • Rocky Fernandes avatar

    Posted on Apr 20, 2012 (permalink)

    myCombo.SelectedIndex = 0;

    Reply

  • Rocky Fernandes avatar

    Posted on Apr 20, 2012 (permalink)

    Seeting selectedIndex to after chnaging the item source also works

    e,g:
    SwimlanesComboBox.SelectedIndex = 0 also works

    Reply

  • Muhammad avatar

    Posted on May 9, 2012 (permalink)

    Hi every one,
    i got a requirement i want to display << Multiple items selected >> when user select more then one item from the multi select combobox and want to display the item if only one item is selected.
    with regards
    shabbir isoft csc

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > MultiSelect option in Combo Box
Related resources for "MultiSelect option in Combo Box"

Silverlight ComboBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]