title: Freeze GridView Header in ASP.NET?
body: <p>I have gridview with 15 and above columns,
  I need to freeze the header of the gridview using the following css :</p>
  
  <pre><code>  .container
          {
              overflow: auto;
          }
          /* Keep the header cells positioned as we scroll */
          .container table th
          {
             position: relative; 
          }
          /* For alignment of the scroll bar */
          .container table tbody
          {
              overflow-x: hidden;
          }
  </code></pre>
  
  <p>body of the grid scroll well but,
  my gridview header is not scrolled on y axis.</p>
  
  <p>my grid view code as follow.</p>
  
  <pre><code>&lt;asp:gridview id="RadGrid1" runat="server" borderstyle="None" borderwidth="1px"
      gridlines="Both" autogeneratecolumns="true" onrowcommand="OnSelectedChanged"
      rowstyle-wrap="false" rowstyle-cssclass="container" 
      onrowdatabound="RadGrid1_RowDataBound" datakeynames="DocID,DocumentName"&gt;
        &lt;headerstyle cssclass="container" backcolor="LightBlue" wrap="false"    
            horizontalalign="Center" verticalalign="Middle" /&gt;
        &lt;selectedrowstyle backcolor="Red" wrap="false" /&gt;
        &lt;columns&gt;
           &lt;asp:TemplateField&gt;
              &lt;HeaderTemplate&gt;
                 &lt;input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);"
                      runat="server" type="checkbox" /&gt;
              &lt;/HeaderTemplate&gt;
              &lt;ItemTemplate&gt;
                 &lt;asp:CheckBox ID="chkSelect" runat="server" /&gt;
              &lt;/ItemTemplate&gt;
           &lt;/asp:TemplateField&gt;
           &lt;asp:ButtonField ButtonType="Link" HeaderText="View" Text="View" CommandName="view" /&gt;
           &lt;asp:ButtonField ButtonType="Link" HeaderText="Activity" Text="Activity" CommandName="activity" /&gt;
        &lt;/columns&gt;
  &lt;/asp:gridview&gt;
  </code></pre>