开发者

How can I build an infinitely recursive listview control?

开发者 https://www.devze.com 2022-12-16 15:36 出处:网络
Not sure I\'m asking the right question, but it\'s a start. I have a user control with a ListView and, ideally, I would like to nest this same control inside of the ListView to provide recursion. This

Not sure I'm asking the right question, but it's a start. I have a user control with a ListView and, ideally, I would like to nest this same control inside of the ListView to provide recursion. This would behave somewhat lik开发者_开发技巧e a TreeView with child nodes.

This might be a monumentally bad idea. :) In fact, I feed like MSFT is pointing me in that direction, because when I try this I am told that I can't do it.

So, how would you do this? What's the right way?


Sounds like You do need a TreeView after all, but need more functionality than it provides by default... How about extending the TreeNode/TreeView?

Here is an example for that: http://www.codeproject.com/KB/tree/DropDownTreeView.aspx

Or you can extend the ListView, in fact, this article shows how to create a TreeListView which sounds very similar to what you're trying to do: http://www.codeproject.com/KB/list/extendedlistviews.aspx

Either way, it sounds like you need a custom control, based on the TreeView and ListView.

Good Luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号