<legend id='6BYKr'><style id='6BYKr'><dir id='6BYKr'><q id='6BYKr'></q></dir></style></legend>
    • <bdo id='6BYKr'></bdo><ul id='6BYKr'></ul>

    <i id='6BYKr'><tr id='6BYKr'><dt id='6BYKr'><q id='6BYKr'><span id='6BYKr'><b id='6BYKr'><form id='6BYKr'><ins id='6BYKr'></ins><ul id='6BYKr'></ul><sub id='6BYKr'></sub></form><legend id='6BYKr'></legend><bdo id='6BYKr'><pre id='6BYKr'><center id='6BYKr'></center></pre></bdo></b><th id='6BYKr'></th></span></q></dt></tr></i><div id='6BYKr'><tfoot id='6BYKr'></tfoot><dl id='6BYKr'><fieldset id='6BYKr'></fieldset></dl></div>

    <tfoot id='6BYKr'></tfoot>

    1. <small id='6BYKr'></small><noframes id='6BYKr'>

      WPF:如何冻结 ListView 标题行,使其不会滚动到屏幕

      时间:2023-08-26
      1. <legend id='OpkOl'><style id='OpkOl'><dir id='OpkOl'><q id='OpkOl'></q></dir></style></legend>
        <tfoot id='OpkOl'></tfoot>
      2. <i id='OpkOl'><tr id='OpkOl'><dt id='OpkOl'><q id='OpkOl'><span id='OpkOl'><b id='OpkOl'><form id='OpkOl'><ins id='OpkOl'></ins><ul id='OpkOl'></ul><sub id='OpkOl'></sub></form><legend id='OpkOl'></legend><bdo id='OpkOl'><pre id='OpkOl'><center id='OpkOl'></center></pre></bdo></b><th id='OpkOl'></th></span></q></dt></tr></i><div id='OpkOl'><tfoot id='OpkOl'></tfoot><dl id='OpkOl'><fieldset id='OpkOl'></fieldset></dl></div>

          <small id='OpkOl'></small><noframes id='OpkOl'>

            <tbody id='OpkOl'></tbody>
            <bdo id='OpkOl'></bdo><ul id='OpkOl'></ul>

                本文介绍了WPF:如何冻结 ListView 标题行,使其不会滚动到屏幕外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我是 WPF 开发的新手,我有一个 ListView,我想冻结标题行,以便在用户滚动列表时它不会滚动到屏幕外.我继承的 xaml 代码如下所示:

                I am new to WPF development, I have a ListView and I want to freeze the header row so that it won't scroll off the screen when the user scrolls the list. The xaml code, I have inherited, looks something like this:

                <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                  <DockPanel>
                    <forms:BindableGrid DockPanel.Dock="Top" [code snipped] >
                    <ListView.View>
                      <GridView>
                        <GridViewColumn Header="ColA" DisplayMemberBinding="{Binding ColA}" />
                        <GridViewColumn Header="ColB" DisplayMemberBinding="{Binding ColB}" />
                           [etc]
                

                推荐答案

                ListView 已经这样做了 - 它有一个内部 ScrollViewer 只滚动项目而不是标题.

                The ListView already does this - it has an internal ScrollViewer that only scrolls the items and not the header.

                问题是你的外部 ScrollViewer 告诉它的孩子(DockPanel)它有无限的可用空间,而 DockPanel 告诉它到它的孩子,所以你的 ListView 最终占用了显示所有项目所需的空间,并且内部 ScrollViewer 不显示.

                The issue is that your outer ScrollViewer tells its child (the DockPanel) that it has infinite space available, and the DockPanel tells this to its children, so your ListView ends up taking up as much space as it needs to display all the items and the internal ScrollViewer doesn't show up.

                如果你拿走你的外部 ScrollViewerListView 应该会发现它的空间有限,并且内部 ScrollViewer 会出现.

                If you take away your outer ScrollViewer, the ListView should pick up that it has limited space, and the internal ScrollViewer will appear.

                这显然会影响 DockPanel 中的其他内容,所以我会看看会发生什么然后从那里开始.

                This will obviously affect the rest of the stuff in your DockPanel, so I'd see what happens and go from there.

                这篇关于WPF:如何冻结 ListView 标题行,使其不会滚动到屏幕外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何向 WCF 中的请求添加授权标头? 下一篇:PdfPTable 作为 iTextSharp 中的标题

                相关文章

                最新文章

              • <legend id='9T8HH'><style id='9T8HH'><dir id='9T8HH'><q id='9T8HH'></q></dir></style></legend>

              • <small id='9T8HH'></small><noframes id='9T8HH'>

                  <bdo id='9T8HH'></bdo><ul id='9T8HH'></ul>

                1. <tfoot id='9T8HH'></tfoot>
                  <i id='9T8HH'><tr id='9T8HH'><dt id='9T8HH'><q id='9T8HH'><span id='9T8HH'><b id='9T8HH'><form id='9T8HH'><ins id='9T8HH'></ins><ul id='9T8HH'></ul><sub id='9T8HH'></sub></form><legend id='9T8HH'></legend><bdo id='9T8HH'><pre id='9T8HH'><center id='9T8HH'></center></pre></bdo></b><th id='9T8HH'></th></span></q></dt></tr></i><div id='9T8HH'><tfoot id='9T8HH'></tfoot><dl id='9T8HH'><fieldset id='9T8HH'></fieldset></dl></div>