具有匹配列的 WPF ListView 嵌套表

发布于 2024-08-19 08:01:54 字数 493 浏览 2 评论 0原文

我有一个像这样的业务实体:

public class Entity
{
    public string Name;
    public string Description;
    public Entity Parent;
    public ObservableCollection<Entity> Children
}

我想将 ListView 绑定到实体集合并从中获取嵌套表,如下所示:

http://leeontech.wordpress.com/2008/03/11/listview-masterdetail/

但是我想要嵌套表(它具有相同的columns 作为其父表)以与父表相同的方式定位和调整其列的大小。我该怎么做?

I have a business entity like so:

public class Entity
{
    public string Name;
    public string Description;
    public Entity Parent;
    public ObservableCollection<Entity> Children
}

I would like to bind a ListView to a collection of Enities and get a nested table out of it like this:

http://leeontech.wordpress.com/2008/03/11/listview-masterdetail/

however I would like the nested table (which has the same columns as its parent) to position and resize its columns the same as the parent table. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迟到的我 2024-08-26 08:01:54

您可能想检查树视图是否适合您;有多种方法可以使其成为多列(TreeListView)。检查此处的示例:TreeListView Sample 是否适合您。应该看起来像下图中的控件:

alt text

控件的源代码您可以在此处找到图片

you might want to check if treeview would work for you; there are ways of making it multi column (TreeListView). Check if example here: TreeListView Sample would work for you. Should be looking like a control on the picture below:

alt text

source code for the control on the picture you can find here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文