2

I m looking out for Multiselect drop down for silverlight4, one available at codeproject is targetted for silverlight3. Any links is highly appreciated.

user420054
  • 65
  • 4
  • 14
  • Most SL3 functionality should port to SL4 with minimal issues if any... – Aaron McIver Dec 30 '10 at 17:51
  • I have tried to use this, http://www.codeproject.com/KB/silverlight/MultiSelComboBox.aspx. This is not running unless I change target silverlight version to 3. – user420054 Dec 30 '10 at 17:53
  • may be this will help you http://stackoverflow.com/questions/3914405/combobox-display-value-in-silverlight – Asim Sajjad Feb 18 '12 at 10:20

1 Answers1

0

If you want to display checkboxes as items of a comboBox, a simple DataTemplate shoud work:

    <ComboBox Name="combo" >
        <ComboBox.ItemTemplate>
            <DataTemplate>
                <CheckBox Content="{Binding Text}" IsChecked="{Binding IsChecked,Mode=TwoWay}"/>
            </DataTemplate>
        </ComboBox.ItemTemplate>
    </ComboBox>

Now on your code behind create an ObservableCollection ChekItem is a basic class:

public class CheckItem
{
    public string Text { get; set; }
    public bool IsChecked { get; set; }
}

and associate it to your comboBox ItemsSource. If you want to know what items are checked, is simple:

var checkedItems = myList.Where(i => i.IsChecked == true);

Kapil
  • 1,823
  • 6
  • 25
  • 47