Hi,
I am creating a combobox in which I have placed check boxes which allows me multiple selection. I tried it in two ways:
1. I used a collection of objects of entities defined by me.
2. Created a datatable and then assigned it to the combobox.
In both the approaches I have same problem of showing the seleced items with check box selected in the combobox.
I have used follwoing code, which is showing me values correctly in the combobox but the problem occures when I want to show the selected item's check box selected. Can anyone suggest me a solution for this Or if you have any other better idea to implement the multiple selecte combobox then I will be greatful to you.
i have used :
<ComboBox Name="cboBox1"
Style="{StaticResource ComboBox}" ItemsSource="{Binding}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<CheckBox Margin="3" Name="chkInsideCboBox1"
DataContext="{Binding ElementName=BusinessEntityName, Path=BusinessEntityId}"
IsChecked="{Binding Path=Default}" Style="{StaticResource CheckBoxFilter}"></CheckBox>
<TextBlock Text="{Binding Path=BusinessEntityNameField}" ></TextBlock>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Thanks in advance
I am creating a combobox in which I have placed check boxes which allows me multiple selection. I tried it in two ways:
1. I used a collection of objects of entities defined by me.
2. Created a datatable and then assigned it to the combobox.
In both the approaches I have same problem of showing the seleced items with check box selected in the combobox.
I have used follwoing code, which is showing me values correctly in the combobox but the problem occures when I want to show the selected item's check box selected. Can anyone suggest me a solution for this Or if you have any other better idea to implement the multiple selecte combobox then I will be greatful to you.
i have used :
<ComboBox Name="cboBox1"
Style="{StaticResource ComboBox}" ItemsSource="{Binding}">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<CheckBox Margin="3" Name="chkInsideCboBox1"
DataContext="{Binding ElementName=BusinessEntityName, Path=BusinessEntityId}"
IsChecked="{Binding Path=Default}" Style="{StaticResource CheckBoxFilter}"></CheckBox>
<TextBlock Text="{Binding Path=BusinessEntityNameField}" ></TextBlock>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Thanks in advance