.NET Winforms DataGridView - 有什么嵌套方法吗?

发布于 2024-10-24 16:40:27 字数 301 浏览 1 评论 0原文

我想我已经知道这个问题的答案了,但我想问一下也没什么坏处。

有没有可能的方法在.NET 中嵌套数据绑定 DataGridView?我希望发生的是 DataGridView 中的每一行都有一个展开按钮,然后在其下方给我一个 DataGridView。我希望这个嵌套的 DataGridView 也能够做到这一点,这样我就可以深入了解它们。

使用 .NET Winforms 标准 DataGridView 可以实现这一点吗? (或者另一个标准的 .NET 控件?)我见过人们引用一些第三方控件,但它们确实很昂贵,而且我真的不想走那条路。

谢谢

I think I already know the answer to this, but I figured it would not hurt to ask.

Is there any possible way to nest Databound DataGridViews in .NET? What I would like to have happen is for each row in the DataGridView to have a button to expand, which would then give me a DataGridView underneath that. I would like this nested DataGridView to also be able to do this, so I could go n levels deep with them.

Is this possible with the .NET Winforms standard DataGridView? (Or another standard .NET control?) I have seen people reference some third party controls, however they are really expensive, and I don't really want to go that route.

Thanks

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

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

发布评论

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

评论(2

缪败 2024-10-31 16:40:27

我不确定这是否是您正在寻找的,但我们有类似的要求并使用 Mark RideoutTreeGridView。它是免费的。但它确实需要您进行一定量的管道操作才能将其连接到数据源。

它的外观如下:

在此处输入图像描述

他的博客是 此处此处 但遗憾的是,他链接到的 zip 文件似乎不可用。

CodeProject 的此页面也可能有用。

I am not certain if this is what you are looking for but we have a similar requirement and use Mark Rideout's TreeGridView. It's free. But it does require that you do a certain amount of plumbing to hook it up to your datasource.

Here's how it looks:

enter image description here

His blog is here and here but sadly it seems as though the zip file he links to is unavailable.

This page at CodeProject may also be useful.

尛丟丟 2024-10-31 16:40:27

直接回答你的问题,不,据我所知,使用标准 DataGridView 或任何其他标准 winforms 控件不可能做到这一点。

To answer your question directly, no, it's not possible do to this with the standard DataGridView, or any other standard winforms control, as far as I know.

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