GridView Headers

G

Guest

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-
 
A

Andrew Robinson

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
 
G

Guest

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>
 
Joined
Oct 24, 2007
Messages
1
Reaction score
0
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 (e-mail address removed) I will reply with solution.

Jest 2 StyleSheets which will solve your need.
 
Joined
Jul 1, 2008
Messages
2
Reaction score
0
Hii

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


amithkumar_k1982 said:
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 (e-mail address removed) I will reply with solution.

Jest 2 StyleSheets which will solve your need.
 

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,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top