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 8874203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:39:32+00:00 2026-06-14T18:39:32+00:00

How can i freeze initial 2 -3 leftmost column in asp.net grid view? so

  • 0

How can i freeze initial 2 -3 leftmost column in asp.net grid view? so that while horizontal scrolling initial 2 – 3 columns that got freezes will always be display.

Any answers??

  • 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-14T18:39:33+00:00Added an answer on June 14, 2026 at 6:39 pm

    Yes, it seems to be possible with some css magic, with the pinned and scrollable columns on different z-indexes to keep the pinned on top. This comes with the caveat that overflow:scroll may not be 100% portable (I’ve tested on IE 8/9 and Chrome FWIW).

    Take a look at this jsFiddle here

    The ASPX I used to generate the GridView is below.

    Note the css classes pinned and scrollable for fixed and scrolling columns respectively (applied to headers and items)

    But the real work is done in the css. Note especially that you need to fiddle to get your column widths correct to align the fixed td’s / th’s at the left.

    aspx

    <div id="scrolledGridView">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="Col 1">
                    <HeaderStyle CssClass="pinned col1"></HeaderStyle>
                    <ItemStyle CssClass="pinned col1"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="Name" HeaderText="Column 2">
                    <HeaderStyle CssClass="pinned col2"></HeaderStyle>
                    <ItemStyle CssClass="pinned col2"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="Description" HeaderText="Column 3">
                    <HeaderStyle CssClass="scrolled"></HeaderStyle>
                    <ItemStyle CssClass="scrolled"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="Cost" HeaderText="Column 4">
                    <HeaderStyle CssClass="scrolled"></HeaderStyle>
                    <ItemStyle CssClass="scrolled"></ItemStyle>
                </asp:BoundField>
            </Columns>
        </asp:GridView>
    

    css

        #scrolledGridView
        {
            overflow-x: scroll; 
            text-align: left;
            width: 400px; /* i.e. too small for all the columns */
        }
    
        .pinned
        {
            position: fixed; /* i.e. not scrolled */
            background-color: White; /* prevent the scrolled columns showing through */
            z-index: 100; /* keep the pinned on top of the scrollables */
        }
        .scrolled
        {
            position: relative;
            left: 150px; /* i.e. col1 Width + col2 width */
            overflow: hidden;
            white-space: nowrap;
            min-width: 500px; /* set your real column widths here */
        }
        .col1
        {
            left: 0px;
            width: 50px;
        }
        .col2
        {
            left: 50px; /* i.e. col1 Width */
            width: 100px;
        }
    

    ​

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

Sidebar

Related Questions

I would like to know if I can freeze the current Activity, while I
How can I freeze Javascript in firebug so that i can inspect the changes
I know I can use ReadKey for that but it will freeze the app
In visual studio, for example, one can freeze/thaw any thread at any time. Is
I'm using cx_Freeze to freeze my Python code so I can distribute it as
I use Object#freeze to freeze the value of an object. I can write a
I have to do something like this Freeze 2010-6-1 How can i write it
How can I freeze a task? I mean, if I have a task task
Using Ruby's ri tool can I get a list of classes that implement the
I'm writing a module that has multiple questions users can chose to answer. Each

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.