WPF中的网格视图标题列问题. [英] Grid View Header Column Problem in WPF.

查看:77
本文介绍了WPF中的网格视图标题列问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我已经开发了一个列表视图,在其中我们需要绑定从数据库加载的数据以及一个复选框.我已经做到了,但是我需要删除GridViewColumnHeader.我在网上搜索并找到了该解决方案.

Hi All,
I have developed a List view in which we need to bind data loaded from the db along with a check box. I have done that but I need to remove the GridViewColumnHeader. I searched net and found this solution.

<ListView>
            <ListView.View>
            <GridView x:Name="gvNew" ColumnHeaderToolTip="Authors">
                    <GridView.ColumnHeaderContainerStyle>
                        <Style>
                            <Setter Property="FrameworkElement.Visibility" Value="Hidden"/>
                        </Style>
                    </GridView.ColumnHeaderContainerStyle>
                        <GridViewColumn Header="Name" Width="120" />
                <GridViewColumn Header="Age" Width="120"/>
            </GridView>
                </ListView.View>
        </ListView>





即使这删除了我的标题,内容仍然如屏幕截图中所示.是否有可能从ListView中完全删除Header.请好好帮忙,因为我被困了几个小时.





Even though this removes my header, the content still appears as in the screen shot. Is it not possible to remove the Header completely from ListView. Kindly help me as I am stuck in this for hours.

推荐答案

您可以隐藏列标题.在页面加载时编写此代码
you can hide the column header . write this code on page load
GridView1.HeaderRow.Visible = false;


这篇关于WPF中的网格视图标题列问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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