简体   繁体   中英

How to sort a GridView by clicking on the header?

I want to sort a GridView by clicking on the header. I guess all i need is the header name and then pass it into sql to get the data back sorted. How is it possible to get the header name?

如果您使用的是标准ASP.NET System.Web.UI.WebControls.GridView ,则可以通过在属性窗格中将“ AllowSorting”设置为true或通过右上角的“弹出”按钮来简单地“启用排序”通过选中“启用排序”来控制控件

我认为,Matt Berseth建议在此处按标题进行排序的最佳解决方案之一

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM