473,545 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ 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 3971
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**********@d iscussions.micr osoft.com> wrote in message
news:51******** *************** ***********@mic rosoft.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>Richa rd Roe</td> <td>CA</td><td>555 Hollywood Boulevard,
Beverly Hills</td><td>19</td></tr>
<tr><td>Samwi se Gamgee</td><td>ME</td><td>1616 Middle Earth Road,
Middle Earth</td> <td>27</td></tr>
<tr><td>Bilbo e 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**********@d iscussions.micr osoft.com> wrote in message
news:51******** *************** ***********@mic rosoft.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
5081
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. Thanks Hans
1
2272
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 not to scroll. Thanks RS
1
2165
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 filters and sort are automaticly managed.... I would like that my own gridview (inherited from system.web.ui.webcontrols.gridview) includes a ODS...
1
3518
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 javascript, nothing really having to do with ASP.NET... I'm attempting to put together an application that consists of several GridView controls each...
2
48396
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 was clicked?? I hope this makes sense? /Claus
4
1148
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
2922
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 é assim: empresa | teste | teste | campo | alfa | alfa...
4
12539
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 Page_Load(object sender, EventArgs e) { ObjectDataSource ods = new ObjectDataSource("MyTestTableAdapter",
1
1817
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 hard to tell what the numbers mean. Thanks, Marvin
0
7484
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3470
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1902
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
726
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.