Scrollable Grid With Fixed Header (Please Help Its Urgent)

Discussion in 'ASP .Net' started by sonali, Aug 16, 2006.

  1. sonali

    sonali Guest

    I Have A Grid With Drop Down List As Template Column
    In Scrolling There Is some Problem

    Code Is As Follows:

    <style type="text/css">
    .gridFixedHeader
    {
    background-color:white;
    position:relative;
    top:expression(GridView1.offsetParent.scrollTop-2);
    }

    .dropdownFix
    {
    behavior:expression(this.style.visibility =
    (this.offsetParent.offsetParent.offsetParent.scrollTop-2) >
    (this.offsetParent.offsetTop -
    this.parentElement.parentElement.parentElement.firstChild.offsetHeight+2)
    ? 'hidden' : 'visible');
    }


    </style>
    </head>
    <body>
    <form id="form1" runat="server">


    <table id="TABLE1" runat="server" >
    <tr>
    <td style="height: 21px">
    <div style=" height: 184px; OVERFLOW: auto; ">
    <asp:GridView ID="GridView1" runat="server"
    HeaderStyle-CssClass="gridFixedHeader " >
    <Columns>
    <asp:TemplateField HeaderText="dropdown" >
    <ItemTemplate>
    <asp:DropDownList ID="DropDownList1"
    runat="server" CssClass="dropdownFix">
    </asp:DropDownList>
    </ItemTemplate>

    </asp:TemplateField>
    <asp:TemplateField HeaderText="proj id">
    <EditItemTemplate>
    <asp:TextBox ID="TextBox1" runat="server"
    Text='<%# Bind("proj_id") %>'></asp:TextBox>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="Label1" runat="server"
    Text='<%# Bind("proj_id") %>'></asp:Label>
    </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="dfxgvfxc">
    <ItemTemplate>
    <asp:CheckBox ID="CheckBox1" runat="server"
    />
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    <HeaderStyle CssClass="gridFixedHeader"
    BorderColor="Black" />
    </asp:GridView>
    </div>
    </td>

    </tr>

    </table>
     
    sonali, Aug 16, 2006
    #1
    1. Advertising

  2. sonali

    eliza81

    Joined:
    Feb 10, 2010
    Messages:
    12
    One workaround is to have a separate table control to show the header elements and h

    One workaround is to have a separate table control to show the header elements and hide the actual header of the grid.Now put the grid inside a div or panel with scrollbar property.But that takes extra effort to have a proper alignment.Each cell of the header table should be aligned with each cell of the grid.The other work around is to fix the header of the grid in such a way that scrolling down shouldnt hide the header of the grid.Using we can achieve that.
     
    eliza81, Mar 8, 2010
    #2
    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. Cristof Falk
    Replies:
    1
    Views:
    478
    =?Utf-8?B?U2hhamk=?=
    May 13, 2005
  2. thunk
    Replies:
    1
    Views:
    330
    thunk
    Mar 30, 2010
  3. thunk
    Replies:
    0
    Views:
    511
    thunk
    Apr 1, 2010
  4. thunk
    Replies:
    14
    Views:
    644
    thunk
    Apr 3, 2010
  5. Mel
    Replies:
    2
    Views:
    203
    Thomas 'PointedEars' Lahn
    Jul 10, 2004
Loading...

Share This Page