Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Show the selected items in a multi select combobox in a wpf datagrid

$
0
0

I have a WPF datagrid, with a multiselect combobox.

 <DataGridTemplateColumn Header="TestItems" Width="140">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <ComboBox Name="cbxTest" ItemsSource="{Binding SelectedTestItems}"  
                                      DisplayMemberPath="TestCode" SelectedValuePath="TestId">
                                <ComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <CheckBox Content="{Binding TestCode}" IsChecked="{Binding Path=IsEdited,Mode=TwoWay}" Tag="{RelativeSource FindAncestor, 
                                           AncestorType={x:Type ComboBox}}" Checked="CheckBox_Click"/>
                                    </DataTemplate>
                                </ComboBox.ItemTemplate>
                            </ComboBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>


The functionality works fine, however i need to show the selected items as a comma seperated text when the combobox is not dropped down. How can this be achieved?




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>