代码之家  ›  专栏  ›  技术社区  ›  Rod

嵌套集和树视图控件

  •  0
  • Rod  · 技术社区  · 15 年前

    给定以下数据库表和示例数据:

    Locations
    Id  ParentId  LeftIndex  RightIndex  Description
    --  --------  ---------  ----------  -----------
    34  2         85         104         Florida Region
    73  34        94         95          Miami
    
    Products
    Id  ParentLocationId  Code  Description
    --  ----------------  ----  -----------
    1   73                MIW0  Miami Magazines
    

    谢谢,

    棒。

    1 回复  |  直到 15 年前
        1
  •  0
  •   Dave Thieben    15 年前

    public class TreeViewEntry {
        public string Name { get; set; }
        public TreeViewEntry[] Children { get; set; }
    }
    

    然后在这个页面上查看jQuery插件和HTML帮助程序: http://www.matthidinger.com/archive/2009/02/08/asp.net-mvc-recursive-treeview-helper.aspx