首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

wpf如何把checkbox放到combobox里面.

2013-10-23 
wpf怎么把checkbox放到combobox里面..本帖最后由 lerbornjames 于 2013-10-22 16:43:09 编辑如题..选中后

wpf怎么把checkbox放到combobox里面..
本帖最后由 lerbornjames 于 2013-10-22 16:43:09 编辑 如题..
选中后能获取到选中行的相关信息..
如:
口 Jack
口 Mary
口 Steve

如果选中Jack和Steve,
那么要获取到"Jack"和"Steve"

求大神给出xaml的代码..  combobox wpf xaml
[解决办法]
类似于这样即可实现了:

<ComboBox.ItemTemplate>
    <DataTemplate>
        <StackPanel Orientation="Horizontal">
            <CheckBox IsChecked="{Binding IsSelected}"
                       Width="20" />
            <TextBlock Text="{Binding DayOfWeek}"
                       Width="100" />
        </StackPanel>
    </DataTemplate>
</ComboBox.ItemTemplate>


http://stackoverflow.com/questions/859227/looking-for-a-wpf-combobox-with-checkboxes/6606691#6606691

热点排行