473,473 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GridView Headers

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-
Nov 19 '05 #1
3 3962
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-

Nov 19 '05 #2
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" <Jo**********@discussions.microsoft.com> wrote in message
news:51**********************************@microsof t.com...
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-

Nov 19 '05 #3
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" <Jo**********@discussions.microsoft.com> wrote in message
news:51**********************************@microsof t.com...
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-


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Hans Merkl | last post by:
Hi, Is there a way to show the column headers of a GridView control even if there is no data? The only thing I see is the EmptyDataTemplate but I would also like to display the column headers. ...
1
by: RS | last post by:
I am using gridview in my web application. I have also implemented sorting and paging. I problem is when I scroll the gridview, the header also scrolls with it. How can I make the gridview headers...
1
by: syl | last post by:
Hello I am trying to create a "easy to use" gridview with filters (dropdownlist in headers), sorting...and much more.... In order to do that, i prefer to use a objectdatasource (ODS) beacause...
1
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all...
2
by: cartmann | last post by:
Hi, I have a gridview with a template column. In the template column i have two commandbuttons. When clicking the buttons I enter the cmd_click event - but how do I read in which row the button...
4
by: wardemon | last post by:
Hi All, I was wondering how to display headers of a gridview on the left, instead of on top (default). Thanks, Henry
1
by: ShiroiRyuu | last post by:
tenho um dataset que tem um numero de colunas variavel que é apresentado num grid view e eu queria podsr agrupar alguns headers desse gridview quando as colunas possuirem o mesmo nome. por exemplo...
4
by: Tomasz | last post by:
Hello Developers, Here is interesting problem I just came across: how do I wire a GridView control programmatically? Here is my sample code using Object Data Source: protected void...
1
by: COHENMARVIN | last post by:
Is there any way to allow the user to see the titles of the columns of his gridview as he scrolls down the page? If I have a grid view with 50 rows, the top titles are no longer in view and its...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.