固定分页和标题的GridView [英] GridView with paging and header as fixed

查看:61
本文介绍了固定分页和标题的GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在具有AllowPaging="true"的可滚动面板中拥有gridview.现在,我要固定标题,也要固定页面编号.向下显示应该是固定的,即仅读取的行应该是可滚动的.我怎样才能达到同样的目的?以下是我的代码.
TRIED <HeaderStyle CssClass="GVFixedHeader" />,但仅修复了标头,而不是分页.对任何帮助表示赞赏.

Hi,
I have the gridview inside a scrollable panel with AllowPaging="true". Now,I want my header to be fixed, also the page no. displayed down should be fixed i.e only the rows fetched should be scrollable. How can i achieve the same? Below is my code.
TRIED <HeaderStyle CssClass="GVFixedHeader" />, but it only fixes the header not the paging.Any help appreciated.

GVFixedHeader { font-weight:bold; background-color: Green; position:absolute;
                 top: expression(Sys.UI.DomElement.getBounds(document.getElementById("pnlContainer")).y-25);
    }







<div id="content">
           <asp:Panel runat="server" ID="pnlContainer" ScrollBars="Vertical" Height="600px">
               <asp:GridView ID="GrdVwHistory" runat="server" CssClass="general" AutoGenerateColumns="False"

                   AllowPaging="true" GridLines="Horizontal" OnPageIndexChanging="GrdVwHistory_PageIndexChanging"

                   PageSize="50">
                   <%--<HeaderStyle CssClass="GVFixedHeader" />--%>
                   <Columns>
                       <asp:BoundField DataField="1" HeaderText="1" />
                       <asp:BoundField DataField="2" HeaderText="2" Visible="false" />
                       <%--<asp:BoundField DataField="3"  HeaderText="3" />--%>
                       <asp:TemplateField HeaderText="3" ControlStyle-CssClass="breakUrl">
                           <ItemTemplate>
                               <asp:Label ID="Label1" runat="server" Text='<%# Bind("3") %>' ToolTip='<%# Bind("3") %>'></asp:Label>
                           </ItemTemplate>
                       </asp:TemplateField>
                       <asp:BoundField DataField="4" HeaderText="4" />
                       <asp:BoundField DataField="5" HeaderText="5" />
                       <asp:BoundField DataField="6" HeaderText="6" />
                       <asp:BoundField DataField="7" HeaderText="7" />
                       <asp:BoundField DataField="8" HeaderText="8" />
                   </Columns>
               </asp:GridView>
           </asp:Panel>
       </div>

推荐答案

自己修复,
已将此CSS样式添加到
<pagerstyle cssclass="GVPager"></pagerstyle>
Fixed it myself,
Added this css style to
<pagerstyle cssclass="GVPager"></pagerstyle>
.GVPager { left: 0px;
width: 958px;
border-right-style: solid;
position: absolute;
top: 720px;
height: 20px;
text-align: right;
border-right-color: navy;}


这篇关于固定分页和标题的GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆