惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
The Hacker News
The Hacker News
L
LINUX DO - 最新话题
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
S
Secure Thoughts
S
Schneier on Security
MyScale Blog
MyScale Blog
月光博客
月光博客
U
Unit 42
www.infosecurity-magazine.com
www.infosecurity-magazine.com
AI
AI
N
News and Events Feed by Topic
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
爱范儿
爱范儿
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
S
Securelist
B
Blog RSS Feed
Spread Privacy
Spread Privacy
H
Help Net Security
Know Your Adversary
Know Your Adversary
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
V
V2EX
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
博客园 - 叶小钗
D
DataBreaches.Net
T
Troy Hunt's Blog
Project Zero
Project Zero
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
K
Kaspersky official blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
S
Security @ Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
The GitHub Blog
The GitHub Blog
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
O
OpenAI News
Recorded Future
Recorded Future
Help Net Security
Help Net Security
罗磊的独立博客

博客园 - 赣江源

StreamInsight参考示例 Microsoft StreamInsight简介 GridView中的DataFormatString失效解决办法 - 赣江源 - 博客园 按照时间点还原数据库(SQL Server) 如何显示在线用户? ASP.NET中每个页面在Load之前调用公用函数 网站单点登录的实现思路 在服务器端提取ASP.NET控件输出的HTML 如何处理在IE7关闭时不出现选项卡提示 使用JavaScript控制UpdatePanel的更新 获取GridView单元格值的通用函数 如何在GridView将数字显示成金额格式或自定义格式? ASP.NET 2.0中使用XSLT的变化 利用AJAX实现DropDownList与GridView做实时更新 输出时清除GridView的Style ASP.NET实现打印的方法小结 提高ASP.NET性能的一点方法 asp.net的一些小技巧 route命令详解
在GridView表头显示排序方向
赣江源 · 2007-11-06 · via 博客园 - 赣江源

代码如下:

//在GridView的RowCreated事件中

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

  if (e.Row.RowType == DataControlRowType.Header) //如果是表头

    foreach (TableCell MyHeader in e.Row.Cells) //对每一单元格     

      if (MyHeader.HasControls())

        if (((LinkButton)MyHeader.Controls[0]).CommandArgument == GridView1.SortExpression)
        //是否为排序列

          if (GridView1.SortDirection == SortDirection.Ascending) //依排序方向加入方向箭头

            MyHeader.Controls.Add(new LiteralControl("↓"));

          else

            MyHeader.Controls.Add(new LiteralControl("↑"));

}