在列 headers 上带有筛选框的扩展 ListView 控件

Extended ListView control with a filter boxes on the column headers

我正在搜索列 headers 上带有筛选框的扩展 ListView 控件 - 例如:

上图来自DataGridExtensions WPF控件,但我需要一个WinForms的控件。

拥有一个基于 ListView 的控件会非常好,但我们也欢迎任何其他帮助(例如 DataGrid-based 控件)。

提前致谢。

您可以通过设置 ListView 属性 OwnerDrawn 自行完成。 处理 DrawListViewColumnHeaderEventHandler 并在那里添加您的控件。然后处理变化,用过滤后的数据替换ListView的内容。或者在使用 VirtualMode.

时替换您的支持数据并刷新控件

如果您想使用现有的免费控件,我建议您查看 CodeProject。例如:

一个简单的:ListViewFilter Control for .NET

还有一个非常复杂的:A Much Easier to Use ListView

DataGridView-AutoFilter is a ready-made Nuget package, you just need to download it and follow this article, it is an easy and enhanced approach. DataGridView-AutoFilter demo example.