473,378 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

how to make datagrid header static

51
i am using asp .net datagrid in my web page to display some data and that data is bound to the datagrid at runtime. the number of columns to bind also determined dynamically at runtime.

the grid contains many rows more than 2000. so when i scroll down to see the bottom rows, the header is not visible as it also scrolls. how can i avoid header static

help me

thanks
Sep 19 '07 #1
4 1818
dip_developer
648 Expert 512MB
i am using asp .net datagrid in my web page to display some data and that data is bound to the datagrid at runtime. the number of columns to bind also determined dynamically at runtime.

the grid contains many rows more than 2000. so when i scroll down to see the bottom rows, the header is not visible as it also scrolls. how can i avoid header static

help me

thanks
there are some ways to do that...one of which is......

read this


besides that such a fixed header can be made using a style like this ::

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

The background color is needed to hide the data rows as they scroll under the header row. Make sure that the style is on a single line, the expression might not work when the style definition uses multiple lines.

Apply the new header style to the DataGrid using the HeaderStyle element:
Sep 19 '07 #2
i am using asp .net datagrid in my web page to display some data and that data is bound to the datagrid at runtime. the number of columns to bind also determined dynamically at runtime.

the grid contains many rows more than 2000. so when i scroll down to see the bottom rows, the header is not visible as it also scrolls. how can i avoid header static

help me

thanks
you can avoid this by using paging concept.
Sep 19 '07 #3
Smish
51
you can avoid this by using paging concept.
The client dont want the paging concept so i cant use it.
any other suggestion would be great.
Sep 19 '07 #4
Smish
51
thanx...

i tried the css method but it is not working.
And regarding the display of header in html tables.... i cant do that cos that requires seting of headerstyle of datagrid to false so the header vanishes ,due to this my column size reduces to 1 cm..the clumns consist of only numeric values...hence the prob..

thanx again..
Sep 19 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Chris F Clark | last post by:
In our C++ project we have some internal bug reporting macros that we use to get useful information when the program does something unexpected. Essentially at the point of the error, we invoke an...
1
by: abacnet | last post by:
Hi eveybody, I have a datagrid that can show many rows, so there is a vertical scrollbar. The problem is that when users scroll down, they loose the view of the header. My idea, right now, is...
7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
2
by: Craig Buchanan | last post by:
Is there a way to add a row to a datagrid during the ItemDataBound event? I would like to add a 'header' row before the start of a group of rows. Thanks, Craig Buchanan
6
by: coleenholley | last post by:
Hi All :-) I need to populate a table I created as a web form. Are there any links to show me how to do this? I CANNOT use a dtagrid for this, the table has to be laid out as follows: Header...
4
by: skOOb33 | last post by:
I successfully autosized the columns and rows on my Datagrid, and am now facing another issue. Having the sorting ability by clicking the column headers is key, but when I do that, it resizes all...
10
by: Extremest | last post by:
I know there are ways to make this a lot faster. Any newsreader does this in seconds. I don't know how they do it and I am very new to c#. If anyone knows a faster way please let me know. All...
3
by: Sharon | last post by:
I have a DataGrid that contains a few rows and column header. I wish to change the DataGrid height to be the exact height of the total height of the rows and column header, so that no gray area...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.