把LINQ to SQL的成果转化为层次结构使用了非有序列表(jQuery的树) [英] Put linq to sql results into hierarchical structure for using in a un-ordered list ( for jquery tree )

查看:203
本文介绍了把LINQ to SQL的成果转化为层次结构使用了非有序列表(jQuery的树)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个L2S类5桌DBML:全球>>分类>>子分类>> >>项项数据。我希望能够从全局表导航下来的树形结构当中去的项目 - 从项数据表中显示标题

I have 5 tables in a L2S Classes dbml : Global >> Categories >> Sub-Category >> Item >> Item Data. I want to be able to navigate from the Global table down a tree like structure to get to the items - displaying the title from the Item Data table.

我有一个使用IHierarchyData / IHierarchicalEnumerable通过遍历集合输出未排序列表,然后我变成与jQuery树上收集延伸现有控件。我这样做是基于<一个href=\"http://stackoverflow.com/questions/636943/return-unordered-list-from-hierarchical-sql-data\">Return从分层SQL数据取消有序列表

I have an existing control that uses a IHierarchyData / IHierarchicalEnumerable extended collection by iterating over the collection to output an un-ordered list which I then turn into a tree with jquery. I did it based on Return Un-Ordered List from hierarchical sql data

有没有一种简单通用的方法,我可以用它来把数据从上面的表结构成一个层次结构,这样我可以重新使用现有的控制,只是传递一个不同的集合。

Is there an easy generic way that I could use to put the data from the above table structure into a a Hierarchical structure so that I could re-use my existing control and and just pass in a different collection.

推荐答案

您是否尝试过的嵌套列表视图?我已经实现在多个页面此解决方案。我用ObjectDataSources,而不是直接LinqDataSources保持我的数据逻辑分离,但嵌套EntitySets做工精美。

Have you tried Nested Listviews? I have implemented this solution in several pages. I use ObjectDataSources instead of LinqDataSources directly to keep my data logic separate, but the nested EntitySets work beautifully.

这篇关于把LINQ to SQL的成果转化为层次结构使用了非有序列表(jQuery的树)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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