Browser - Internet Explorer 9
Utilizing the most recent version of Microsoft's AdventureWorks2012 sandbox database (AdventureWorks2012_Data.zip) for SQL related data.
No C# page utilized behind the scenes
To start with, there are no issues with the SQL or how the SQL data in the GridView is presented (aside from the Frozen Header)
I am currently investigating why the Frozen header I have set up for a GridView embedded in a panel moves along with mouse scroll whenever the mouse hovers over the header or 'Edit' links at the beginning and end of each row.
The behaviors observed are as follows:
Scenario 1 - Mouse Hovers Over Edit Link While Scrolling - When the mouse hovers over the 'Edit' link and scrolls up or down, the frozen header moves with the mouse scroll. However, when the mouse hovers in the data area of the GridView, the header remains frozen. Hovering over the header while scrolling keeps it in place. Moving the mouse off the Frozen Header after scrolling causes the header to reappear at the top of the page or disappear completely. If the header disappears entirely, hovering the mouse over the Edit link brings the header back into view.
Scenario 2 - Mouse Hovers Over Frozen Header While Scrolling - As an attempt to resolve the issue, switching the editing links to buttons was tried to check if it solves the problem. Scrolling the GridView with the mouse hovered over the 'Edit' buttons has no effect on the header. The header stays in place and functions correctly. Scrolling with the mouse in the data area keeps the Frozen Header in the paneled GridView frozen. However, hovering over the header while scrolling maintains its position. Once the mouse is moved off the Frozen Header after scrolling, the same behavior of reappearing at the top of the page or disappearing entirely occurs.
Here's the code for Scenario 1. More code can be provided if necessary.
CSS
.header-frozen {
font-weight: bold;
background-color: white;
position: relative;
visibility: visible;
}
ASP.NET
<div >
<asp:Panel ID="Panel1" Height="600px" Width="9000px" ScrollBars="Vertical" runat="server">
<asp:GridView ID="GridView1" Width="100%" Height="600px" runat="server" AllowSorting="True" HeaderStyle-CssClass="GridViewStyle" AutoGenerateColumns="False" DataKeyNames="BusinessEntityID" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
<HeaderStyle CssClass="GridViewHeaderStyle" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField HeaderStyle-CssClass="GridViewHeaderStyle" HeaderStyle-BackColor="#507CD1" DataField="BusinessEntityID" HeaderText="Business Entity ID" ReadOnly="True" SortExpression="BusinessEntityID" InsertVisible="False" ShowHeader="False" >
<HeaderStyle BackColor="#507CD1" ForeColor="White"></HeaderStyle>
</asp:BoundField>
<!-- Additional BoundFields will go here -->
<asp:CommandField ShowEditButton="True"/>
</Columns>
<HeaderStyle CssClass="header-frozen" Height="60px" />
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorks2012ConnectionString %>" SelectCommand="SELECT [BusinessEntityID],[NationalIDNumber],[LoginID],[OrganizationNode],[OrganizationLevel],[JobTitle],[BirthDate],[MaritalStatus],[Gender],[HireDate],[SalariedFlag],[VacationHours],[SickLeaveHours],[CurrentFlag],[rowguid],[ModifiedDate] FROM [HumanResources].[Employee]" UpdateCommand="UPDATE [HumanResources].[Employee] SET SELECT [NationalIDNumber] = @NationalIDNumber,[LoginID] = @LoginID,[OrganizationNode] = @OrganizationNode,[OrganizationLevel] = @OrganizationLevel,[JobTitle] = @JobTitle,[BirthDate] = @BirthDate,[MaritalStatus] = @MaritalStatus,[Gender] = @Gender,[HireDate] = @HireDate,[SalariedFlag] = @SalariedFlag,[VacationHours] = @VacationHours,[SickLeaveHours] = @SickLeaveHours,[CurrentFlag] = @CurrentFlag,[rowguid] = @rowguid,[ModifiedDate] = @ModifiedDate WHERE [BusinessEntityID] = @BusinessEntityID">
<UpdateParameters>
<asp:Parameter Name="NationalIDNumber" />
<asp:Parameter Name="LoginID" />
<!-- Additional Parameters will go here -->
<asp:Parameter Name="BusinessEntityID" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:Panel>
</div>
Samples of what I'm observing: