c# - 如何判断 ListView 正在显示哪些项目?

标签 c# xaml windows-8 windows-runtime

<分区>

这个问题与 WinRT 有关。

我如何知道哪些项目当前显示在 ListView 上(部分或全部)?

除此之外,我如何找到 ListView 中的顶部项目是什么?

查看了 ListView 类,并没有真正找到任何东西。

最佳答案

要找到最上面的一个,您可以执行以下操作:

ListViewItem topItem = listView1.TopItem;

不确定能看到多远,但如果有帮助,您也可以...

listView1.Items[0].EnsureVisible();

...使列表中的特定项目可见 - 如果需要,它会自动为您滚动。

关于c# - 如何判断 ListView 正在显示哪些项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12868328/

相关文章:

installation - Windows 8驱动程序安装和目录/签名验证

c# - 为 csv 记录中的无效字段数抛出异常

C#/WPF : Binding to an element outside of the visual/logical tree

node.js - 为什么 Node.js 脚本控制台会在 Windows 8 中立即关闭?

.net - 允许非开发人员定义 Workflow Foundation 4 流程的解决方案

c# - XAML - MediaElement 没有播放我的音乐

windows-8 - 为Xbox One开发应用程序?

c# - 请求 URL "HelloWorld"如何在 ASP.Net MVC 中实例化 HelloWorldController 对象?

c# - foreach(Frm.Controls 中的 Control ctrl)控制的顺序

c# - 在 C# 中使用半字节