GridView排序ASP.NET [英] GridView Sorting ASP.NET

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

问题描述

当我对GridView ASC或DESC进行排序时,我在该页面上单击GridView中的Next或Last Page,GridView未排序,因为我在页面索引更改时重新绑定了我的GridView。



我的网格是否有任何方式在页面索引更改中排序。

提前使用。

when i sort my GridView ASC or DESC and i click on Next OR Last Page in GridView on that Page the GridView is Not Sorted Because i Rebind My GridView on Page Index Change.

Is there any way that my Grid is Sorted too on Page Index Change.
Thanx in Advance.

推荐答案

检查out

ASP.NET 2.0的GridView示例:对GridView进行分页和排序''数据 [ ^ ]


http://stackoverflow.com / questions / 702600 / sorting-and-paging-with-gridview-asp-net [ ^ ]

http://www.c-sharpcorner.com/uploadfile/9aea29/grid-view-paging-and- sort-in-Asp-Net / [ ^ ]


您对DataSouce(即数据表)的直接排序有何看法?如果您直接对数据源进行排序,那么在重新绑定GridView之后,您也将拥有已排序的数据。您可以使用linq对数据源(即数据表)进行排序,也可以调用DataTable的 Sort()函数。

请参阅类似的讨论如下:

如何对数据表进行排序在c#.net [ ^ ]





--Amit
What you think about sorting the DataSouce i.e., datatable directly. If you''ll sort the datasource directly then after rebinding the GridView also you''ll be having sorted data. You can perform the sorting on datasource(i.e., your datatable) using linq as well as calling the Sort() function of DataTable.
See the similar discussion below:
How To Sort Datatable in c#.net[^]


--Amit


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

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