按页面顺序对gridview列进行排序

按页面顺序对gridview列进行排序

本文介绍了在select查询中使用order by时,按页面顺序对gridview列进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我正在将数据从sqlserver提取到gridview.
我正在使用按国家/地区排序"对gridview列(国家/地区代码)进行排序
和按代码排序"
在查询中.我的意思是,我不使用datview.sort属性进行排序.
排序和分页一切正常...

我的问题是:

当我转到nextpage(page2)并单击标题进行排序时,它正在对所有数据进行排序.我只需要对page2中的数据进行排序.我知道原因是排序是从数据库而不是网格中进行的.

我该如何实现这一目标....请尽快提供帮助

感谢

解决方案


hii am fetching the data from the sqlserver to the gridview.
i am sorting the gridview columns(country,code)using "order by country"
and "order by code"
in the query. I mean, iam not sorting using the datview.sort property.
sorting and paging all working fine...

my problem is:

when i go to nextpage(page2) and clicked on header to sort, it is sorting all the data. i need to sort only the data in page2. i know the reason is the sorting is from database not in the grid.

how can I achieve this in my case....please help ASAP

thanks

解决方案


这篇关于在select查询中使用order by时,按页面顺序对gridview列进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 03:56