.NET Winforms DataGridView - 有什么嵌套方法吗?
我想我已经知道这个问题的答案了,但我想问一下也没什么坏处。
有没有可能的方法在.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定这是否是您正在寻找的,但我们有类似的要求并使用 Mark Rideout 的 TreeGridView。它是免费的。但它确实需要您进行一定量的管道操作才能将其连接到数据源。
它的外观如下:
他的博客是 此处 和此处 但遗憾的是,他链接到的 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:
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.
直接回答你的问题,不,据我所知,使用标准 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.