如何在Combobox中显示树视图 [英] How Do I Show A Treeview In Combobox

查看:72
本文介绍了如何在Combobox中显示树视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一个comboxbox中的treeview中显示show数据。可以任何人说或者给一个控件来源,这样我就可以自定义我的需求

解决方案

< blockquote>你需要这样的东西吗?



 <  < span class =code-leadattribute>网格 >  
< ComboBox x:名称 = comboBox Horizo​​ntalAlignment = 高度 = 41 保证金 = 62,44,0, 0 VerticalAlignment = Top 宽度 = 347 >
< ComboBoxItem >
< span class =code-keyword>< ComboBoxItem.Template >
< ControlTemplate >
< TreeView 高度 = 自动 >
< TreeViewItem 标题 = 1级 / >
< TreeViewItem 标题 = Level 1 B IsExpanded = True >
< TreeViewItem 标题 = 等级2 / >
< ; / TreeViewItem >
< / TreeView >
< / ControlTemplate >
< / ComboBoxItem.Template >
< / ComboBoxItem >
< / ComboBox >

< / Grid >


I need to show the show datas in treeview inside a comboxbox..Can any one say or give a control with source so that i can customize to my reqirements

解决方案

Do you need something like this?

<Grid>
    <ComboBox x:Name="comboBox" HorizontalAlignment="Left" Height="41" Margin="62,44,0,0" VerticalAlignment="Top" Width="347">
        <ComboBoxItem>
            <ComboBoxItem.Template>
                <ControlTemplate>
                    <TreeView Height="auto">
                        <TreeViewItem Header="Level 1 A" />
                        <TreeViewItem Header="Level 1 B" IsExpanded="True" >
                            <TreeViewItem Header="Level 2"/>
                        </TreeViewItem>
                    </TreeView>
                </ControlTemplate>
            </ComboBoxItem.Template>
        </ComboBoxItem>
    </ComboBox>

</Grid>


这篇关于如何在Combobox中显示树视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆