zoukankan
html css js c++ java
冻结DataGrid中的列的比较简单的实现方法!
第一次写文章发到首页,有什么不妥的地方还请各位大虾批评!
今天看到CSDN网友有问冻结DataGrid中的列的问题,以前知道一个冻结DataGrid的
Header的方法比较简单,所以想试试!
费话少说先贴源码
<style type="text/css">
.fixTitle
{
}
{
POSITION
:
relative
;
TOP
:
expression(this.offsetParent.scrollTop)
}
.fixCol
{
}
{
POSITION
:
relative
;
Left
:
expression(this.offsetParent.scrollLeft)
}
</style>
<
DIV
style
="Z-INDEX: 102; LEFT: 264px; OVERFLOW: auto; WIDTH: 184px; POSITION: relative; TOP: 128px; HEIGHT: 216px"
ms_positioning
="GridLayout"
>
<
asp:DataGrid
id
="DataGrid1"
style
="Z-INDEX: 103"
runat
="server"
BorderColor
="#DEBA84"
BorderStyle
="None"
BorderWidth
="1px"
BackColor
="#DEBA84"
CellPadding
="0"
AutoGenerateColumns
="False"
>
<
SelectedItemStyle
Font-Bold
="True"
ForeColor
="White"
BackColor
="#738A9C"
></
SelectedItemStyle
>
<
ItemStyle
ForeColor
="#8C4510"
BackColor
="#FFF7E7"
></
ItemStyle
>
<
HeaderStyle
Font-Bold
="True"
ForeColor
="White"
BackColor
="#A55129"
></
HeaderStyle
>
<
FooterStyle
ForeColor
="#8C4510"
BackColor
="#F7DFB5"
></
FooterStyle
>
<
Columns
>
<
asp:BoundColumn
DataField
="IntegerValue"
HeaderText
="IntegerValue"
HeaderStyle-CssClass
="fixCol"
ItemStyle-CssClass
="fixCol"
></
asp:BoundColumn
>
<
asp:BoundColumn
DataField
="StringValue"
HeaderText
="StringValue"
></
asp:BoundColumn
>
<
asp:BoundColumn
DataField
="CurrencyValue"
HeaderText
="CurrencyValue"
></
asp:BoundColumn
>
</
Columns
>
<
PagerStyle
HorizontalAlign
="Center"
ForeColor
="#8C4510"
Mode
="NumericPages"
></
PagerStyle
>
</
asp:DataGrid
></
DIV
>
以前不知道从哪位高手那里看到的fixTitle的Css,在这里谢过了!
如果你想冻结那列就把 fixCol这个Css加到 那列的
HeaderStyle-CssClass 和 ItemStyle-CssClass 中去
这里我是冻结的第一列。
看看效果吧
查看全文
相关阅读:
c++ 迷宫问题
linux下恢复删除的文件
c++ 分解数2
c++ 平分石头
多态
设计模式中类的6种关系
工厂方法模式
设计原则之面向接口编程
封装、继承
便利构造器、单件模式
原文地址:https://www.cnblogs.com/goody9807/p/225872.html
最新文章
高手养成之路;你不知道数据恢复秘诀在这里
如何解决硬盘固件区损坏?只要学会这几步
服务器断电导致raid信息丢失的解决过程
VSAN存储结构解析+存储数据恢复案例
35、【opencv入门】运动物体检测(1)
34、【opencv入门】重映射 & SURF特征点检测合辑
33、【opencv入门】角点检测之Harris角点检测
32、【opencv入门】GrabCut & FloodFill图像分割
31、【opencv入门】分水岭算法及图像修补
30、【opencv入门】轮廓查找与绘制(8)——轮廓特征属性及应用
热门文章
29、【opencv入门】轮廓查找与绘制(7)——位置关系及轮廓匹配
28、【opencv入门】轮廓查找与绘制(6)——外接圆、椭圆拟合、逼近多边形曲线、计算轮廓面积及长度、提取不规则轮廓
27、【opencv入门】轮廓查找与绘制(5)——最小外接矩形
26、【opencv入门】轮廓查找与绘制(4)——正外接矩形
补圣衣
石子归并
c++ 砝码秤重
c++最长公共子序列
c++最长上升子序列
c++数字三角形
Copyright © 2011-2022 走看看