问高手一个关于ASPxGrid的问题,谢谢哦? ( 积分: 100 )

  • 主题发起人 主题发起人 charlie_sky
  • 开始时间 开始时间
C

charlie_sky

Unregistered / Unconfirmed
GUEST, unregistred user!
我想显示所有的记录,设置pagesize=0,
要使ASPxGrid的head和foot固定,记录数超过height就显示滚动条,该怎么设置呀?
 
我想显示所有的记录,设置pagesize=0,
要使ASPxGrid的head和foot固定,记录数超过height就显示滚动条,该怎么设置呀?
 
不好设置要用到客户端代码以下是客户端代码:
<HTML><HEAD><TITLE>锁定表格栏位范例网页</TITLE>
<META http-equiv=Content-Type content=&quot;text/html;
charset=gb2312&quot;>
<STYLE type=text/css>BODY {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FONT: 12px 细明体;
CURSOR: default
}
TD {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FONT: 12px 细明体;
CURSOR: default
}
.title {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BORDER-RIGHT: #555 1px solid;
PADDING-RIGHT: 4px;
BORDER-TOP: #fff 1px solid;
PADDING-LEFT: 4px;
BACKGROUND: #ccc;
PADDING-BOTTOM: 4px;
OVERFLOW: hidden;
BORDER-LEFT: #fff 1px solid;
CURSOR: hand;
PADDING-TOP: 4px;
BORDER-BOTTOM: #555 1px solid;
WHITE-SPACE: nowrap
}
.cdata {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BORDER-RIGHT: #ddd 1px solid;
PADDING-RIGHT: 3px;
BORDER-TOP: #fff 1px solid;
PADDING-LEFT: 3px;
BACKGROUND: #fff;
PADDING-BOTTOM: 3px;
OVERFLOW: hidden;
BORDER-LEFT: #fff 1px solid;
PADDING-TOP: 3px;
BORDER-BOTTOM: #ddd 1px solid;
WHITE-SPACE: nowrap
}
</STYLE>
<SCRIPT language=JavaScript >
// 栏位标题 ( 栏位名称 # 栏位宽度 # 资料对齐 )
var DataTitles=new Array(
&quot;歌手 / 团体#90 #left&quot;
,
&quot;专辑名称 #130#left&quot;
,
&quot;发行公司 #110#left&quot;
,
&quot;本周排名 #58 #center&quot;,
&quot;排名状况 #58 #center&quot;,
&quot;上周排名 #58 #center&quot;,
&quot;上榜周数 #58 #center&quot;,
&quot;最高名次 #58 #center&quot;,
&quot;销售百分比 #70 #center&quot;)
// 栏位资料 ( 二维阵列 )
var DataFields=new Array()
DataFields[0] =new Array(&quot;萧亚轩&quot;
,&quot;爱的主打歌-吻&quot;
,&quot;维京 Virgin&quot;
,&quot;1&quot;
,&quot;持平&quot;
,&quot;1&quot;
,&quot;2&quot;,&quot;1&quot;
,&quot;2.9 %&quot;)
DataFields[1] =new Array(&quot;张惠妹&quot;
,&quot;发烧&quot;
,&quot;华纳 Warner&quot;
,&quot;2&quot;
,&quot;持平&quot;
,&quot;2&quot;
,&quot;2&quot;,&quot;2&quot;
,&quot;2.1 %&quot;)
DataFields[2] =new Array(&quot;陶吉吉&quot;
,&quot;黑色柳丁&quot;
,&quot;全员集合 Shock&quot;
,&quot;3&quot;
,&quot;持平&quot;
,&quot;3&quot;
,&quot;5&quot;,&quot;1&quot;
,&quot;1.8 %&quot;)
DataFields[3] =new Array(&quot;S.H.E&quot;
,&quot;美丽新世界&quot;
,&quot;华研 HIM&quot;
,&quot;4&quot;
,&quot;持平&quot;
,&quot;4&quot;
,&quot;6&quot;,&quot;1&quot;
,&quot;1.2 %&quot;)
DataFields[4] =new Array(&quot;艾薇儿&quot;
,&quot;展翅高飞&quot;
,&quot;博德曼 BMG&quot;
,&quot;5&quot;
,&quot;新进榜&quot;,&quot;-&quot;
,&quot;1&quot;,&quot;5&quot;
,&quot;1.1 %&quot;)
DataFields[5] =new Array(&quot;任贤齐&quot;
,&quot;一个任贤齐&quot;
,&quot;滚石 Rock&quot;
,&quot;6&quot;
,&quot;新进榜&quot;,&quot;-&quot;
,&quot;1&quot;,&quot;6&quot;
,&quot;1.0 %&quot;)
DataFields[6] =new Array(&quot;范逸臣&quot;
,&quot;范逸臣第一张专辑&quot;,&quot;丰华 Forward&quot;
,&quot;7&quot;
,&quot;持平&quot;
,&quot;7&quot;
,&quot;2&quot;,&quot;7&quot;
,&quot;0.9 %&quot;)
DataFields[7] =new Array(&quot;谢霆锋&quot;
,&quot;无形的他全精选&quot;
,&quot;新力 Sony&quot;
,&quot;8&quot;
,&quot;下跌&quot;
,&quot;6&quot;
,&quot;4&quot;,&quot;4&quot;
,&quot;0.9 %&quot;)
DataFields[8] =new Array(&quot;周蕙&quot;
,&quot;寂寞城市&quot;
,&quot;福茂 Decca&quot;
,&quot;9&quot;
,&quot;下跌&quot;
,&quot;5&quot;
,&quot;3&quot;,&quot;5&quot;
,&quot;0.8 %&quot;)
DataFields[9] =new Array(&quot;周杰伦&quot;
,&quot;八度空间&quot;
,&quot;博德曼 BMG&quot;
,&quot;10&quot;,&quot;下跌&quot;
,&quot;8&quot;
,&quot;8&quot;,&quot;1&quot;
,&quot;0.8 %&quot;)
DataFields[10]=new Array(&quot;酷玩乐团&quot;,&quot;玩过头&quot;
,&quot;科艺百代 EMI&quot;
,&quot;11&quot;,&quot;上升&quot;
,&quot;16&quot;,&quot;2&quot;,&quot;11&quot;,&quot;0.7 %&quot;)
DataFields[11]=new Array(&quot;张震岳&quot;
,&quot;等我有一天&quot;
,&quot;魔岩 Magicstone&quot;,&quot;12&quot;,&quot;新进榜&quot;,&quot;-&quot;
,&quot;1&quot;,&quot;12&quot;,&quot;0.6 %&quot;)
DataFields[12]=new Array(&quot;堂本刚&quot;
,&quot;红与蓝&quot;
,&quot;艾回 Avex&quot;
,&quot;13&quot;,&quot;新进榜&quot;,&quot;-&quot;
,&quot;1&quot;,&quot;13&quot;,&quot;0.6 %&quot;)
DataFields[13]=new Array(&quot;ENERGY&quot;
,&quot;COME ON&quot;
,&quot;环球 Universal&quot;
,&quot;14&quot;,&quot;下跌&quot;
,&quot;10&quot;,&quot;9&quot;,&quot;5&quot;
,&quot;0.6 %&quot;)
DataFields[14]=new Array(&quot;陈冠希&quot;
,&quot;TRANSITION&quot;
,&quot;艾回 Avex&quot;
,&quot;15&quot;,&quot;下跌&quot;
,&quot;9&quot;
,&quot;3&quot;,&quot;5&quot;
,&quot;0.4 %&quot;)
DataFields[15]=new Array(&quot;合辑&quot;
,&quot;MTV 嘻哈大师&quot;
,&quot;环球 Universal&quot;
,&quot;16&quot;,&quot;下跌&quot;
,&quot;12&quot;,&quot;3&quot;,&quot;12&quot;,&quot;0.4 %&quot;)
</SCRIPT>
<SCRIPT language=JavaScript>
var BoxWidth = 480&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// 资料表显示宽度 ( 不含卷轴 )
var ShowLine = 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// 资料表显示列数
var RsHeight = 21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// 资料列高度
var LockCols = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// 要锁定的栏位数 ( 由左至右 )
function WriteTable(){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// 写入表格
var iBoxWidth=BoxWidth
var NewHTML=&quot;<table border=/&quot;0/&quot;
cellpadding=/&quot;0/&quot;
cellspacing=/&quot;0/&quot;><tr>/
<td><div style=/&quot;width:100%;overflow-x:scroll/&quot;>/
<table border=/&quot;0/&quot;
cellpadding=/&quot;0/&quot;
cellspacing=/&quot;0/&quot;><tr>&quot;
for(i=0;i<DataTitles.length;i++){
if(i<LockCols){
var cTitle=DataTitles.split(&quot;#&quot;)
iBoxWidth-=cTitle[1]
var DynTip=((i+1)==LockCols)?&quot;解除锁定&quot;:&quot;锁定此栏位&quot;
NewHTML+=&quot;<td><div class=/&quot;title/&quot;
style=/&quot;width:&quot;+cTitle[1]+&quot;px;height:&quot;+RsHeight+&quot;px/&quot;
title=/&quot;&quot;+DynTip+&quot;/&quot;
onclick=/&quot;ResetTable(&quot;+i+&quot;)/&quot;>&quot;+cTitle[0]+&quot;</div></td>&quot;
}
}
NewHTML+=&quot;</tr>/
<tr><td colspan=/&quot;&quot;+LockCols+&quot;/&quot;>/
<div id=/&quot;DataFrame1/&quot;
style=/&quot;position:relative;width:100%;overflow:hidden/&quot;>/
<div id=/&quot;DataGroup1/&quot;
style=/&quot;position:relative/&quot;></div></div>/
</td></tr></table></div></td>/
<td valign=/&quot;top/&quot;><div style=/&quot;width:&quot;+iBoxWidth+&quot;px;overflow-x:scroll/&quot;>/
<table border=/&quot;0/&quot;
cellpadding=/&quot;0/&quot;
cellspacing=/&quot;0/&quot;><tr>&quot;
for(i=0;i<DataTitles.length;i++){
if(i>=LockCols){
var cTitle=DataTitles.split(&quot;#&quot;)
NewHTML+=&quot;<td><div class=/&quot;title/&quot;
style=/&quot;width:&quot;+cTitle[1]+&quot;px;height:&quot;+RsHeight+&quot;px/&quot;
title=/&quot;锁定此栏位/&quot;
onclick=/&quot;ResetTable(&quot;+i+&quot;)/&quot;>&quot;+cTitle[0]+&quot;</div></td>&quot;
}
}
NewHTML+=&quot;</tr>/
<tr><td colspan=/&quot;&quot;+(DataTitles.length-LockCols)+&quot;/&quot;>/
<div id=/&quot;DataFrame2/&quot;
style=/&quot;position:relative;width:100%;overflow:hidden/&quot;>/
<div id=/&quot;DataGroup2/&quot;
style=/&quot;position:relative/&quot;></div>/
</div></td></tr></table>/
</div></td><td valign=/&quot;top/&quot;>/
<div id=/&quot;DataFrame3/&quot;
style=/&quot;position:relative;background:#000;overflow-y:scroll/&quot;
onscroll=/&quot;SYNC_Roll()/&quot;>/
<div id=/&quot;DataGroup3/&quot;
style=/&quot;position:relative;width:1px;visibility:hidden/&quot;></div>/
</div></td></tr></table>&quot;
DataTable.innerHTML=NewHTML
ApplyData()
}
function ApplyData(){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// 写入资料
var NewHTML=&quot;<table border=/&quot;0/&quot;
cellpadding=/&quot;0/&quot;
cellspacing=/&quot;0/&quot;>&quot;
for(i=0;i<DataFields.length;i++){
NewHTML+=&quot;<tr>&quot;
for(j=0;j<DataTitles.length;j++){
if(j<LockCols){
var cTitle=DataTitles[j].split(&quot;#&quot;)
NewHTML+=&quot;<td><div class=/&quot;cdata/&quot;
style=/&quot;width:&quot;+cTitle[1]+&quot;px;height:&quot;+RsHeight+&quot;px;text-align:&quot;+cTitle[2]+&quot;/&quot;>&quot;+DataFields[j]+&quot;</div></td>&quot;
}
}
NewHTML+=&quot;</tr>&quot;
}
NewHTML+=&quot;</table>&quot;
DataGroup1.innerHTML=NewHTML

var NewHTML=&quot;<table border=/&quot;0/&quot;
cellpadding=/&quot;0/&quot;
cellspacing=/&quot;0/&quot;>&quot;
for(i=0;i<DataFields.length;i++){
NewHTML+=&quot;<tr>&quot;
for(j=0;j<DataTitles.length;j++){
if(j>=LockCols){
var cTitle=DataTitles[j].split(&quot;#&quot;)
NewHTML+=&quot;<td><div class=/&quot;cdata/&quot;
style=/&quot;width:&quot;+cTitle[1]+&quot;px;height:&quot;+RsHeight+&quot;px;text-align:&quot;+cTitle[2]+&quot;/&quot;>&quot;+DataFields[j]+&quot;</div></td>&quot;
}
}
NewHTML+=&quot;</tr>&quot;
}
NewHTML+=&quot;</table>&quot;
DataGroup2.innerHTML=NewHTML
DataFrame1.style.pixelHeight=RsHeight*ShowLine
DataFrame2.style.pixelHeight=RsHeight*ShowLine
DataFrame3.style.pixelHeight=RsHeight*ShowLine+RsHeight
DataGroup3.style.pixelHeight=RsHeight*(DataFields.length+1)
}
function ResetTable(n){
var iBoxWidth=0
for(i=0;i<DataTitles.length;i++){
if(i<(n+1)){
var cTitle=DataTitles.split(&quot;#&quot;)
iBoxWidth+=parseInt(cTitle[1])
}
}
if(iBoxWidth>BoxWidth){
var Sure=confirm(&quot;/n锁定栏位的宽度大於资料表显示的宽  /n/n度,这可能会造成版面显示不正常。/n/n/n您确定要继续吗?&quot;)
}else
{
Sure=true
}
if(Sure){
LockCols=(LockCols==n+1)?0:n+1
WriteTable()
}
}
function SYNC_Roll(){
DataGroup1.style.posTop=-DataFrame3.scrollTop
DataGroup2.style.posTop=-DataFrame3.scrollTop
}
window.onload=WriteTable
</SCRIPT>
<META content=&quot;MSHTML 6.00.2800.1170&quot;
name=GENERATOR></HEAD>
<BODY>
<CENTER>
<H4>锁定表格栏位范例网页</H4><!--// 资料表 ( 开始 ) //-->
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD
style=&quot;BORDER-RIGHT: white 2px inset;
BORDER-TOP: white 2px inset;
BORDER-LEFT: white 2px inset;
BORDER-BOTTOM: white 2px inset;
BACKGROUND-COLOR: scrollbar&quot;>
<DIV id=DataTable></DIV></TD></TR></TBODY></TABLE><!--// 资料表 ( 结束 ) //-->
<P>点取栏位标题可重新设定或解除目前的锁定状态</P></CENTER></BODY></HTML>
 
接受答案了.
 
后退
顶部