WPF - 制作的ListView(GridView控件)滚动时太多的数据? [英] WPF - Making ListView (GridView) Scroll when too much data?
问题描述
<Grid>
<ListView ItemsSource="....">
<ListView.View>
<GridView>
<GridViewColumn ......../>
</GridView>
</ListView.View>
</ListView>
</Grid>
当有成千上万行的上述XAML导致电网
来尺寸比形成更大的和数据被隐藏。
When there are thousands of rows the above XAML causes the Grid
to size larger than the form and the data becomes hidden.
我想要做的就是保持的ListView
,使其充满了网格(填写表格),并有一个垂直滚动条通过项目滚动(顶部留在原位标题行)。就像一个WinForm格会。
What I want to do is to keep the ListView
so that it fills the grid (which fills the form), and to have a vertical scrollbar to scroll through the items (leaving the header row in place at the top). Just like a WinForm grid would.
谁能告诉我如何实现这一目标?我不希望使用第三方组件。
Can anyone tell me how to achieve this? I don't want to use 3rd party components.
感谢
推荐答案
presumably你的电网
中举办的的StackPanel
。摆脱了它应该很好地工作。
Presumably your Grid
is hosted in a StackPanel
. Get rid of that and it should work fine.
这篇关于WPF - 制作的ListView(GridView控件)滚动时太多的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!