代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Asp.Net
】
GridView固定表头
作者:
Dezai.CN
/ 发布于
2012/6/27
/
628
GridView固定表头
<div><span style="color: rgb(0, 0, 255);"><!</span><span style="color: rgb(255, 0, 255);">DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">html </span><span style="color: rgb(255, 0, 0);">xmlns</span><span style="color: rgb(0, 0, 255);">="http://www.w3.org/1999/xhtml"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">head </span><span style="color: rgb(255, 0, 0);">runat</span><span style="color: rgb(0, 0, 255);">="server"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">GridView固定表头 清清月儿http://blog.csdn.net/21aspnet </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">style</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(128, 0, 0); background-color: rgb(245, 245, 245);"> .Freezing </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">{</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"> position</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">relative </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"> table-layout</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">fixed</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"> top</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">expression(this.offsetParent.scrollTop)</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"> z-index</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);"> 10</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">}</span><span style="color: rgb(128, 0, 0); background-color: rgb(245, 245, 245);"> .Freezing th</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">{</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);">text-overflow</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">ellipsis</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);">overflow</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">hidden</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);">white-space</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);"> nowrap</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(255, 0, 0); background-color: rgb(245, 245, 245);">padding</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">:</span><span style="color: rgb(0, 0, 255); background-color: rgb(245, 245, 245);">2px</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">;</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">}</span><span style="color: rgb(128, 0, 0); background-color: rgb(245, 245, 245);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">style</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">body </span><span style="color: rgb(255, 0, 0);">style</span><span style="color: rgb(0, 0, 255);">="font-size=12px"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">form </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="form1"</span><span style="color: rgb(255, 0, 0);"> runat</span><span style="color: rgb(0, 0, 255);">="server"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">div </span><span style="color: rgb(255, 0, 0);">style</span><span style="color: rgb(0, 0, 255);">="overflow-y: scroll; height: 200px;width:300px"</span><span style="color: rgb(255, 0, 0);"> id</span><span style="color: rgb(0, 0, 255);">="dvBody"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">asp:GridView </span><span style="color: rgb(255, 0, 0);">ID</span><span style="color: rgb(0, 0, 255);">="GridView1"</span><span style="color: rgb(255, 0, 0);"> runat</span><span style="color: rgb(0, 0, 255);">="server"</span><span style="color: rgb(255, 0, 0);"> AutoGenerateColumns</span><span style="color: rgb(0, 0, 255);">="False"</span><span style="color: rgb(255, 0, 0);"> CellPadding</span><span style="color: rgb(0, 0, 255);">="3"</span><span style="color: rgb(255, 0, 0);"> OnRowDeleting</span><span style="color: rgb(0, 0, 255);">="GridView1_RowDeleting"</span><span style="color: rgb(255, 0, 0);"> OnRowEditing</span><span style="color: rgb(0, 0, 255);">="GridView1_RowEditing"</span><span style="color: rgb(255, 0, 0);"> OnRowUpdating</span><span style="color: rgb(0, 0, 255);">="GridView1_RowUpdating"</span><span style="color: rgb(255, 0, 0);"> OnRowCancelingEdit</span><span style="color: rgb(0, 0, 255);">="GridView1_RowCancelingEdit"</span><span style="color: rgb(255, 0, 0);"> BackColor</span><span style="color: rgb(0, 0, 255);">="White"</span><span style="color: rgb(255, 0, 0);"> BorderColor</span><span style="color: rgb(0, 0, 255);">="#CCCCCC"</span><span style="color: rgb(255, 0, 0);"> BorderStyle</span><span style="color: rgb(0, 0, 255);">="None"</span><span style="color: rgb(255, 0, 0);"> BorderWidth</span><span style="color: rgb(0, 0, 255);">="1px"</span><span style="color: rgb(255, 0, 0);"> Font-Size</span><span style="color: rgb(0, 0, 255);">="12px"</span><span style="color: rgb(255, 0, 0);"> OnRowCreated</span><span style="color: rgb(0, 0, 255);">="GridView1_RowCreated"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">FooterStyle </span><span style="color: rgb(255, 0, 0);">BackColor</span><span style="color: rgb(0, 0, 255);">="White"</span><span style="color: rgb(255, 0, 0);"> ForeColor</span><span style="color: rgb(0, 0, 255);">="#000066"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">Columns</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">asp:BoundField </span><span style="color: rgb(255, 0, 0);">DataField</span><span style="color: rgb(0, 0, 255);">="身份证号码"</span><span style="color: rgb(255, 0, 0);"> HeaderText</span><span style="color: rgb(0, 0, 255);">="编号"</span><span style="color: rgb(255, 0, 0);"> ReadOnly</span><span style="color: rgb(0, 0, 255);">="True"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">asp:BoundField </span><span style="color: rgb(255, 0, 0);">DataField</span><span style="color: rgb(0, 0, 255);">="邮政编码"</span><span style="color: rgb(255, 0, 0);"> HeaderText</span><span style="color: rgb(0, 0, 255);">="邮政编码"</span><span style="color: rgb(255, 0, 0);"> SortExpression</span><span style="color: rgb(0, 0, 255);">="邮政编码"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">asp:BoundField </span><span style="color: rgb(255, 0, 0);">DataField</span><span style="color: rgb(0, 0, 255);">="家庭住址"</span><span style="color: rgb(255, 0, 0);"> HeaderText</span><span style="color: rgb(0, 0, 255);">="家庭住址"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">asp:BoundField </span><span style="color: rgb(255, 0, 0);">DataField</span><span style="color: rgb(0, 0, 255);">="姓名"</span><span style="color: rgb(255, 0, 0);"> HeaderText</span><span style="color: rgb(0, 0, 255);">="姓名"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">Columns</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">RowStyle </span><span style="color: rgb(255, 0, 0);">ForeColor</span><span style="color: rgb(0, 0, 255);">="#000066"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">SelectedRowStyle </span><span style="color: rgb(255, 0, 0);">BackColor</span><span style="color: rgb(0, 0, 255);">="#669999"</span><span style="color: rgb(255, 0, 0);"> Font-Bold</span><span style="color: rgb(0, 0, 255);">="True"</span><span style="color: rgb(255, 0, 0);"> ForeColor</span><span style="color: rgb(0, 0, 255);">="White"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">PagerStyle </span><span style="color: rgb(255, 0, 0);">BackColor</span><span style="color: rgb(0, 0, 255);">="White"</span><span style="color: rgb(255, 0, 0);"> ForeColor</span><span style="color: rgb(0, 0, 255);">="#000066"</span><span style="color: rgb(255, 0, 0);"> HorizontalAlign</span><span style="color: rgb(0, 0, 255);">="Left"</span><span style="color: rgb(255, 0, 0);"> CssClass</span><span style="color: rgb(0, 0, 255);">="ms-formlabel DataGridFixedHeader"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">HeaderStyle </span><span style="color: rgb(255, 0, 0);">BackColor</span><span style="color: rgb(0, 0, 255);">="#006699"</span><span style="color: rgb(255, 0, 0);"> Font-Bold</span><span style="color: rgb(0, 0, 255);">="True"</span><span style="color: rgb(255, 0, 0);"> ForeColor</span><span style="color: rgb(0, 0, 255);">="White"</span><span style="color: rgb(255, 0, 0);"> CssClass</span><span style="color: rgb(0, 0, 255);">="Freezing"</span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">asp:GridView</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">div</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">form</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">></span></div>
试试其它关键字
GridView固定表头
同语言下
.
gzip压缩
.
实现http多线程断点续传下载文件
.
实现多线程断点续传下载大文件
.
生成字符串的 CheckSum
.
根据 UserAgent 获取浏览器的类型和版本
.
根据 Agent 判断是否是智能手机
.
隐藏手机号中间四位为*方法
.
合并图片(二维码和其他图片合并)
.
ASP.NET CORE中判断是否移动端打开网页
.
ASP.NET(C#)实现页面计时(定时)自动跳转
可能有用的
.
实现测量程序运行时间及cpu使用时间
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3