Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

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



XML
<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>
Posted
Updated 2-Feb-12 0:02am
v3

1 solution

Fixed it myself,
Added this css style to
<pagerstyle cssclass="GVPager"></pagerstyle>
HTML
.GVPager { left: 0px;
width: 958px;
border-right-style: solid;
position: absolute;
top: 720px;
height: 20px;
text-align: right;
border-right-color: navy;}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900