Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8738279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:42:05+00:00 2026-06-13T10:42:05+00:00

I have an ASP.NET Panel that has a gridview inside of it. Below is

  • 0

I have an ASP.NET Panel that has a gridview inside of it. Below is the markup for it:

<asp:Panel runat="server" ID="searchResultsPanel" CssClass="datagrid" ClientIDMode="Static" style="display:none; max-height:500px; max-width:700px; overflow:auto;" >
    <asp:GridView runat="server" ID="gridMemberInfo" AutoGenerateColumns="false" EmptyDataText="No Members Were Found." OnRowCommand="Command_SearchGrid" ShowHeader="true" ShowHeaderWhenEmpty="true" >
        <PagerSettings Visible="false" />
        <AlternatingRowStyle CssClass="alt" />
        <Columns>
            <asp:ButtonField ButtonType="Link" Text="Select" CommandName="SelectRow" />
            <asp:BoundField  HeaderText="PMI"                DataField="PMI" />
            <asp:BoundField  HeaderText="Product"            DataField="Product" ItemStyle-Width="110px"  />
            <asp:BoundField  HeaderText="County"             DataField="County" />
            <asp:BoundField  HeaderText="Last Name"          DataField="LastName" />
            <asp:BoundField  HeaderText="First Name"         DataField="FirstName" />
            <asp:BoundField  HeaderText="Currently Enrolled" DataField="CurrentlyEnrolled" ItemStyle-Width="50px" />
        </Columns>
    </asp:GridView>
</asp:Panel>

I have the following CSS for the panel and gridview:

.datagrid table 
{ 
    border-collapse: collapse; 
    text-align: left; 
    width: 100%; 
} 

.datagrid 
{
    font: normal 12px/150% Arial, Helvetica, sans-serif; 
    background: #fff; 
    overflow: hidden; 
    border: 2px solid #006699; 
    -webkit-border-radius: 10px; 
    -moz-border-radius: 10px; 
    border-radius: 10px; 
}

.datagrid table td, .datagrid table th 
{ 
    padding: 3px 10px; 
}

.datagrid table thead th 
{
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #00A2F2), color-stop(1, #002C42) );
    background:-moz-linear-gradient( center top, #00A2F2 5%, #002C42 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00A2F2', endColorstr='#002C42');
    background-color:#00A2F2; 
    color:#FFFFFF; 
    font-size: 12px; 
    font-weight: bold; 
    border: none;
} 

.datagrid table thead th:first-child 
{ 
    border: 3px; 
}

.datagrid table tbody td
{ 
    color: #00496B; 
    font-size: 12px;
    font-weight: normal; 
}

.datagrid table tbody .alt td 
{ 
    background: #E1EEF4; 
    color: #00496B; 
}

.datagrid table tbody td:first-child 
{ 
    border-left: none; 
}

.datagrid table tbody tr:last-child td 
{ 
    border-bottom: none; 
}

In order for the gridview to render with thead elements, I do this in the code behind: this.gridMemberInfo.HeaderRow.TableSection = TableRowSection.TableHeader;

Since I have the panel’s overflow set to auto, I can scroll when the gridview has alot of rows. What I would like to do now is make the header row fixed so that I can always see it while scrolling. I have tried setting position:fixed; in the .datagrid table thead th CSS class but that hasn’t worked. I have tried several other options and no luck. Can someone help me out with this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:42:06+00:00Added an answer on June 13, 2026 at 10:42 am

    You cannot do that on IE, since thead is not regarded with there css interpreter. you will need to implement a wapping div that will hold your headers. or use ones that did it before : http://www.scientificpsychic.com/blogentries/html-and-css-scrolling-table-with-fixed-heading.html

    or you can take a look at:

    http://demos.devexpress.com/ASPxGridViewDemos/PagingAndScrolling/Scrolling.aspx

    taken from stack answer : Fixed GridView Header with horizontal and vertical scrolling in asp.net

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Asp.Net 4.0 website/control interface that uses an update panel and some
I have an ASP.NET 4 webpage that contains an update panel which just allows
I have an ASP.NET Web Form (C#) that users fill out, it has a
I have a custom control that extends ASP.NET Update panels. On the server side
I'm using asp.net/c# and have a number of Collapsible Panel Extenders that have been
I have this serious: I have ASP.NET page, This page contents Update panel with
I have an asp.net page with three ajax updatepanels. in each panel there are
I have a custom Asp.net control as public class ImageControl : Panel { private
I am working on asp.net application and I have an update panel like this:
I have asp.net mvc 4 web application project on my server in IIS Directory.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.