具有固定页眉和页脚的可滚动gridview

编程入门 行业动态 更新时间:2024-10-28 08:30:54
本文介绍了具有固定页眉和页脚的可滚动gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我想要使用固定页眉和页脚的Scrollable GridView使用CSS类并在GridView页眉和页脚中调用该Css类。但问题是当我向下滚动标题丢失时,当我向上滚动页脚丢失时。但我想修复页眉和页脚并仅滚动DataRow对象。这该怎么做。任何人都可以给我一些有价值的建议.. 我的代码如下所示

< style type =text / css>。 GVFixedHeader { font-weight : 粗体背景颜色:绿色position:relative top:expression(this.parentNode.parentNode.parentNode.scrollTop-1)} 。 GVFixedFooter { font-weight : 粗体背景 - 颜色:绿色位置:相对底部:表达式(getScrollBottom(this.parentNode.parentNode.parentNode.parentNode))} < / style>

< script language = javascript type = text / javascript> function getScrollBottom(p_oElem){ return p_oElem.scrollHeight - p_oElem.scrollTop - p_oElem.clientHeight}< /脚本>

并在Grid Header,Footer样式中调用Css类。

< FooterStyle BackColor = #507CD1字体 - 粗体= True ForeColor = White CssClass = GVFixedFooter / > < HeaderStyle BackColor = #507CD1 Font-Bold = True ForeColor = 白色 CssClass = GVFixedHeader />

注意:将我的网格放在Panel Control中 请找到附件以便更好地理解.. 在此先感谢... [可滚动] [可滚动]

解决方案

试试这个...... :) www.aspsnippets/Articles/Scrollable-GridView-with-Fixed-Headers-in-ASP.Net .aspx [ ^ ] 如果你想简单,

< div style = overflow:auto; widht:100%; height:YourHeight > < asp:gridview xmlns:asp = #unknown > ..... < / asp:gridview > < / div >

Hi Everybody, I want Scrollable GridView with Fixed header and Footer for that purpose im using CSS class and call that Css class in GridView Header and footer also. But whats the problem is when i scroll down header is missing , when i scroll up footer is missing. But i want to fix header and footer and scrolling only DataRow objects . How to do this. Can any one give me some valueble suggestions out of this.. My code is look like below

<style type="text/css">.GVFixedHeader { font-weight:bold background-color: Green position:relative top:expression(this.parentNode.parentNode.parentNode.scrollTop-1)}.GVFixedFooter { font-weight:bold background-color: Green position:relative bottom:expression(getScrollBottom(this.parentNode.parentNode.parentNode.parentNode))} </style>

<script language="javascript" type="text/javascript"> function getScrollBottom(p_oElem) { return p_oElem.scrollHeight - p_oElem.scrollTop - p_oElem.clientHeight }</script>

and call that Css class in Grid Header, Footer styles.

<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" CssClass="GVFixedFooter"/> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" CssClass="GVFixedHeader" />

Note: Place my grid inside Panel Control Please find the attachments for better understanding.. Thanks in Advance... [ scrollable] [ scrollable]

解决方案

Try this...:) www.aspsnippets/Articles/Scrollable-GridView-with-Fixed-Headers-in-ASP.Net.aspx[^] if you want simple,

<div style="overflow:auto; widht:100%; height:YourHeight"> <asp:gridview xmlns:asp="#unknown"> ..... </asp:gridview> </div>

更多推荐

具有固定页眉和页脚的可滚动gridview

本文发布于:2023-10-08 03:13:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1471344.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页眉   gridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!