Scrollable Grid With Fixed Header (Please Help Its Urgent)

S

sonali

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>
 
Joined
Feb 10, 2010
Messages
12
Reaction score
0
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top