GridView Headers

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9zZXBoIEdvcmRvbg==?=, Nov 14, 2005.

  1. I need to "freeze" the headers for a webforms gridview. I have found no
    documentation or articles that explain how to accomplish this using the
    ASP.NET 2.0 GridView control.

    I really prefer not to have to add this functionality myself as I had to in
    the 1.1 framework, please tell me it's built-in.

    Thanks,
    -JGordon-
     
    =?Utf-8?B?Sm9zZXBoIEdvcmRvbg==?=, Nov 14, 2005
    #1
    1. Advertising

  2. What do you mean by "freeze"?

    Jason Lind

    "Joseph Gordon" wrote:

    > I need to "freeze" the headers for a webforms gridview. I have found no
    > documentation or articles that explain how to accomplish this using the
    > ASP.NET 2.0 GridView control.
    >
    > I really prefer not to have to add this functionality myself as I had to in
    > the 1.1 framework, please tell me it's built-in.
    >
    > Thanks,
    > -JGordon-
     
    =?Utf-8?B?SmFzb24gTCBMaW5k?=, Nov 14, 2005
    #2
    1. Advertising

  3. If you mean freeze as in don't scroll while the items scroll below the head,
    this unfortunately can't be done. It just doesn't exist in HTML.

    I have seen people attempt to use iframes but inevitably, the headers don't
    line up with the items below them.

    -Andrew


    "Joseph Gordon" <> wrote in message
    news:...
    >I need to "freeze" the headers for a webforms gridview. I have found no
    > documentation or articles that explain how to accomplish this using the
    > ASP.NET 2.0 GridView control.
    >
    > I really prefer not to have to add this functionality myself as I had to
    > in
    > the 1.1 framework, please tell me it's built-in.
    >
    > Thanks,
    > -JGordon-
     
    Andrew Robinson, Nov 14, 2005
    #3
  4. I would be content with something like this:


    <table style="table-layout: fixed; width: 100%;" cellpadding='0'
    cellspacing='0' border='1'>
    <col style="width: 100px;" />
    <col style="width: 50px" />
    <col style="width: 100%;" />
    <col style="width: 50px;" />
    <col style="width: 17px" /><!-- This is the width of the scrollbar -->
    <tr>
    <td>Name</td>
    <td>State</td>
    <td>Address</td>
    <td>Age</td>
    <td> </td>
    </tr>
    </table>
    <span style="position: absolute; width: 100%; height: 200px;
    overflow-y: scroll;">
    <table style="table-layout: fixed; width: 100%; height: 100%;"
    cellpadding='0' cellspacing='0' border='1'>
    <col style="width: 100px;" />
    <col style="width: 50px" />
    <col style="width: 100%;" />
    <col style="width: 50px;" />
    <% for (int i = 0; i < 10; i++)
    { %>
    <tr><td>John Doe</td> <td>TN</td><td>123 Maple Street,
    Nashville</td> <td>21</td></tr>
    <tr><td>Richard Roe</td> <td>CA</td><td>555 Hollywood Boulevard,
    Beverly Hills</td><td>19</td></tr>
    <tr><td>Samwise Gamgee</td><td>ME</td><td>1616 Middle Earth Road,
    Middle Earth</td> <td>27</td></tr>
    <tr><td>Bilboe Baggins</td><td>ME</td><td>101 Round the bend,
    Shire</td> <td>111</td></tr>
    <% } %>
    </table>
    </span>



    "Andrew Robinson" wrote:

    > If you mean freeze as in don't scroll while the items scroll below the head,
    > this unfortunately can't be done. It just doesn't exist in HTML.
    >
    > I have seen people attempt to use iframes but inevitably, the headers don't
    > line up with the items below them.
    >
    > -Andrew
    >
    >
    > "Joseph Gordon" <> wrote in message
    > news:...
    > >I need to "freeze" the headers for a webforms gridview. I have found no
    > > documentation or articles that explain how to accomplish this using the
    > > ASP.NET 2.0 GridView control.
    > >
    > > I really prefer not to have to add this functionality myself as I had to
    > > in
    > > the 1.1 framework, please tell me it's built-in.
    > >
    > > Thanks,
    > > -JGordon-

    >
    >
    >
     
    =?Utf-8?B?Sm9zZXBoIEdvcmRvbg==?=, Nov 16, 2005
    #4
  5. =?Utf-8?B?Sm9zZXBoIEdvcmRvbg==?=

    amithkumar_k1982

    Joined:
    Oct 24, 2007
    Messages:
    1
    Frozen Header for GridView

    Hi,

    I have found solutions for frozen header for gridview control which will work for VS2005/VS2008. Any body need solution please email me on I will reply with solution.

    Jest 2 StyleSheets which will solve your need.
     
    amithkumar_k1982, Oct 24, 2007
    #5
  6. =?Utf-8?B?Sm9zZXBoIEdvcmRvbg==?=

    pushkarr

    Joined:
    Jul 1, 2008
    Messages:
    2
    Hii

    Hiii..
    You can freeze header using Division tag..
     
    pushkarr, Jul 1, 2008
    #6
  7. =?Utf-8?B?Sm9zZXBoIEdvcmRvbg==?=

    pushkarr

    Joined:
    Jul 1, 2008
    Messages:
    2
    Hii

    Hey man what is your email id...?
    Please send me the Solution if you can..


     
    pushkarr, Jul 1, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hans Merkl
    Replies:
    4
    Views:
    10,755
    Steven Cheng[MSFT]
    Nov 15, 2005
  2. RS
    Replies:
    3
    Views:
    15,706
    prashiddha
    Nov 27, 2011
  3. dont bother
    Replies:
    0
    Views:
    866
    dont bother
    Mar 3, 2004
  4. Phil
    Replies:
    4
    Views:
    732
    Gabriel Genellina
    Jan 17, 2010
  5. Ian
    Replies:
    2
    Views:
    2,103
Loading...

Share This Page