如何创建分层的网格结构? [英] How to create a hierarchical grid structure ?

查看:159
本文介绍了如何创建分层的网格结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个带有父子关系的表,即

id名称parent
1个0
2 b 0
3 c 1
4 d 1
5 e 2
6 f 3

现在0父ID表示顶层实体,现在我想以分层方式将其与网格绑定,即父->孩子-等等.

用户还可以从网格中添加,编辑和删除数据.

Hi all,

I have a table with parent child relation i.e.

id name parent
1 a 0
2 b 0
3 c 1
4 d 1
5 e 2
6 f 3

where 0 parent id means top level entity.Now I want to bind this with my grid in hierarchical manner i.e. parent -> child -- and so on.

Also user can add,edit and delete data from grid.

推荐答案

请使用System.Windows.Forms.TreeView:
https://msdn.microsoft.com/zh-cn/library/system.windows.forms.treeview%28v = vs.110%29.aspx [
Please use System.Windows.Forms.TreeView:
https://msdn.microsoft.com/en-us/library/system.windows.forms.treeview%28v=vs.110%29.aspx[^].

—SA


这篇关于如何创建分层的网格结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆