分层(多列)排序为.NET GridView的? [英] Hierarchical (Multi-column) Sorting for the .net GridView?

查看:123
本文介绍了分层(多列)排序为.NET GridView的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个简单的净的方式来做到分层分类

Is there a simple ".Net" way to do hierarchical sorting

表...

A|B|C
-----
1|2|5
2|8|4
2|4|3
3|7|2
4|4|1

点击A,则B会得到你。

clicking on A, then B would get you..

A|B|C
-----
1|2|5
2|4|3
2|8|4
3|7|2
4|4|1

的变化是,我正在整理(二)(一)环境等等。

The change being that I'm sorting (B) in context of (A) and so forth.

显然,这可以在数据源进行管理,但不知道是否有人有一个优雅的,可扩展的解决方案..感谢。

Obviously this could be managed in the datasource, but was wondering if someone has a elegant and scalable solution.. thanks.

推荐答案

如果你问这样做它与分页的同时,有没有简单的,可扩展的解决方案。事实上,这是怎样的一个神圣的业务应用程序的Web开发的圣杯。见,例如,计算器问题<一href="http://stackoverflow.com/questions/149380/dynamic-sorting-within-sql-stored-procedures">Dynamic在SQL存储过程,它涉及同样的事情排序。毕竟,如果我们有动态排序在我们的数据库服务器,我们将只需要$ C C的机制,用于管理用户的排序选择$。

If you're asking about doing it in conjunction with paging, there's no simple and scalable solution. In fact, that is kind of a holy grail of business application web development. See, for example, the StackOverflow question Dynamic Sorting within SQL Stored Procedures, which concerns the same thing. After all, if we had dynamic sorting on our database servers, we would only have to code the mechanism for managing the user's sort choices.

您真的只有三种选择多列排序:

You really only have three options for multi-column sorts:

  • 做到这一点,在客户端,让你的数据容器做繁重(当你使用具有该功能的内置,像<一个数据容器href="http://ms-help%3A//MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.NETDEVFX.v20.en/c$p$pf4/html/P%5FSystem%5FData%5FDataView%5FSort.htm"相对=nofollow> System.Data.DataView )。

写自己的算法,并结合之前的数据自己进行排序。

Write your own algorithm and sort the data yourself before binding.

通过上面的链接所讨论的解决方案之一,它做在数据库服务器。

Do it at the database server via one of the solutions discussed in the link above.

无论是客户端解决方案是真正可扩展的,因为它们涉及拉,并提供所有的数据时,你可能只需要一个子集。

Neither of the client-side solutions are really scalable since they involve pulling and delivering all your data when you may only need a subset.

这篇关于分层(多列)排序为.NET GridView的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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