--- In [email protected], [EMAIL PROTECTED] wrote:
>
> Hi all,
> 
> I have a Gridview on my web page and I use the paging feature.  
But due to user requirements, I need to load all rows into my 
gridview control and instead of paging, allow the user to scroll 
thru the rows.  Not to worry, the most rows that can be loaded is 
about 100 so performance is not an issue.  I also want to display 
only 10 rows in my gridview at a time.  Then I want vertical 
scrollbars to allow the user to go thru these rows.  I also want the 
headings to be stationary and not move as the user scrolls.  Is this 
possible and if so can someone get me started?
> 
> Thanks,
> Bob
> 
> [Non-text portions of this message have been removed]
>

Hi Bob,

I don't know if GridView allows you to generate HTML that will to 
that job for you, but I think you will have to do this yourself 
because it is a little tricky.

First, you will need a standard HTML table with 2 rows. The first 
rows (about 20px height) will have the header on it (column names). 
The second one (100% height), will contain a span (or a div as you 
want) that enables overflow with the style="overflow-y: auto;". You 
will then put another HTML table (that has the same number of 
columns as the header have) and make it's width 100%, with no 
height. Then, you will size your column headers the same way you 
size the TDs of your inner-most table, so these 2 tables will seem 
to be in the same table. If you want a tip to be sure the columns 
header are the same height as your inner table, create a javascript 
function that loops throught your headers and dynamically set the 
TD's width to the same value for each column. You can call this on 
body.onload in JS. That way, if you have text in one cell that is 
too long to be displayed, your headers will be adjusted to that. 

By doing that you will see a normal HTML table with all your data in 
it (like it is a normal gridview), but, with a vertical scrollbar !

Hope it works you Bob.

WebMasterSam

Reply via email to