简体   繁体   中英

how to get combobox checkbox checked values in c# using wpf

                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <CheckBox 

                     Style="{StaticResource CheckBoxStyle}" 

                     Content="{Binding CDM_VALUE1}" CommandParameter="{Binding}"  

                     Command="{Binding ElementName=MyWindow, Path=DataContext.SetSelectAllCommand}"/>
                    </DataTemplate>

i have given here in checkbox as item template

you need to add parameter IsChecked in your XAML code

IsChecked="{Binding Path=SetSelectAllCommand, Mode=TwoWay}"

this link may help you How can I get the checked checkbox values using MVVM?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM