gpt4 book ai didi

c# - 有没有办法在 ListView 中嵌套分组?或者我必须使用 TreeView 吗?

转载 作者:行者123 更新时间:2023-11-30 21:10:46 27 4
gpt4 key购买 nike

基本上,我有一个 Foo 的集合。

public class Foo
{
public string Section { get; set; }
public string SubSection { get; set; }

public string item { get; set; }
}

我希望我的 Foo 按部分分组,然后按子部分分组。

Section A
Section A1
- Item A1.0
- Item A1.1
Section A2
- Item A2.0
- Item A2.1
- Item A2.2
Section B
... etc

最佳答案

Treeview 可能是一种解决方案,或者您可以使用 ListView 并提供您自己的样式模板,该模板支持通过绑定(bind)显示嵌套数据。另见 this SO question .

关于c# - 有没有办法在 ListView 中嵌套分组?或者我必须使用 TreeView 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8302043/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com